May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Kill processes for user

Kill processes for user

To easily kill all processes running under a user

ps -u USER | awk ‘{print $1}’ | xargs kill -9

or

pkill -u USER

replacing USER with the username.

To kill all specific processes such as php running under a user run,

ps -u USER | grep PROCESS |awk ‘{print $1}’ | xargs kill -9

replacing USER with username and PROCESS with php or any other process.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>