Jump to content

Kill specific user processes

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Guest_Lop_*

Guest_Lop_*
  • Guests
I can see specific users in top (now htop :)) and would like to kill all processes of a specific user. The only thing is I don't know how. I can kill them one by one with the PID id but is there a command that allows me to kill per user?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Use this command:

kill -9 `ps -u <username> -o "pid="`

which will terminate all pids owned by your users with a sig level of 9.

#3
Guest_erik_*

Guest_erik_*
  • Guests
What does the ps -u command do?

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
ps - report a snapshot of the current processes.

-U: userlist
select by real user ID (RUID) or name.
It selects the processes whose real user name or ID is in the userlist list. The real user ID identifies the user who created the process, see getuid(2).