linux: kill all my processes but not this terminal

18,964

Solution 1

This kills all processes except the ones associated with the current terminal:

kill `ps -o pid= -N T`

Solution 2

But just want to say don't use -9 as a knee jerk mechanism as it should be used as a last resort. It can't be caught by the process and doesn't let a process cleanup its resources.

Try maybe kill -15 instead to start.

Share:
18,964

Related videos on Youtube

flybywire
Author by

flybywire

Updated on September 17, 2022

Comments

  • flybywire
    flybywire over 1 year

    I want an easy way in linux to kill all my current processes.

    The problem with kill -9 -1 is that it also kills the current terminal. Is there an easy way to kill everything except the current terminal?

  • ThorstenS
    ThorstenS almost 15 years
    doesn't work under debian. ps lists all processes
  • tink
    tink over 5 years
    That may well be ... but if executed as root or under sudo that brings down the system. stackoverflow.com/questions/53048310/… :D