Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Jul 16 '09 at 9:52

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted

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

kill `ps -o pid= -N T`
share|improve this answer
doesn't work under debian. ps lists all processes – ThorstenS Jul 16 '09 at 11:04
The "T" argument to "ps" selects all processes associated with the current terminal and "-N" will negate that. – Inshalla Jul 16 '09 at 16:32

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|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.