How kill all processes of particular user?

Scenario: Want to kill all processes of particular user, fire the following command:

kill -9 $(pgrep -u username)

Ex: kill -9 $(pgrep -u nobody)

OR

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

Ex: kill -9 `ps -u nobody -o "pid="`

    0 comments: