Short Tip: Kill all user processes

shell.png
I use the kill command quite often to kill processes left over – the most common usage is actually when I log into a machine via ssh -X and start a KDE 3.5.x program. Quite some processes will remain running afterwards (dcop, kdeinit, etc.) and will not shut down for quite some while.

I’m used to ps -aux|grep kde in such a case to get the process numbers and kill these with kill -9 PID usually, but for several processes this might take some time. It’s faster to kill just all processes which belong the the user of the kill signal:

kill -9 -1

Keep in mind that you will also kill the konsole you are in right now!

Yet again a tip to make an every day job just a little bit easier. :)

7 Responses to “Short Tip: Kill all user processes”

  1. Fran Says:

    Suicidal tip…

  2. zDen Says:

    There is also killall which can do the same…

  3. FACORAT Fabrice Says:

    You’d better not do this when you are root …
    This will kill everything, including the kernel.

  4. Mike Says:

    There is also pkill kde, pkill (and its sibling pgrep) is a ps | grep | xargs kill like of thing.

    regards,
    Mike

  5. liquidat Says:

    Fran, of course this is a suicidal tip – that’s the purpose of the command!

    And Mike, thanks for these tips, but the KDE part was just one part were this command can be useful.

  6. Anders Says:

    I usually use the “slay” command as root to kill all processes belonging to a specific user. Good for resetting.

  7. Garrett Says:

    Ubuntu (and i’m not sure what other flavors of linux) has:

    killall -u USERNAME


Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 37 other followers