Bash Shell Awesomeness - Mass Killing Processes (On Ubuntu)
skorks.com
skorks.com
I must use killall 100 times a day :)
ps -u www-data -o pid --no-headers
That gives me just the PIDs of the processes run by www-data.So much good stuff in there.
Good reminder to do a periodic review of that stuff, not all the options are easy to remember if you don't use them frequently enough.
Kudos to the original poster. That sort of combining of small tools is what the NIX command-line is all about.
pkill -9 -U lusername
Unlike in Linux, in most unices killall(1) terminates all the processesHehe... That reminds me of the day I learned that you shouldn't put . in your path, especially in the front.
It turns out that (old?) Red Hat machines had a script 'killall' in their /etc/init.d ...
You don't want charaters this to that, what you do want is column 2.
That said, there are better ways still to solve this problem. Some of them were detailed above. One that wasn't was the fact that GNU ps has lots of filtering options itself, in this case:
ps -eo pid -U 1002
Does the work of the grep and cut from the original for you.