Kill all processes for a given user

后端 未结 5 950
情深已故
情深已故 2020-12-12 12:52

Is there a reliable way to kill all the processes of a given user? kill(-1, SIGKILL) as that user will work, unless a rogue process of that user kills the killi

5条回答
  •  醉话见心
    2020-12-12 13:44

    On Debian LINUX, I use: ps -o pid= -u username | xargs sudo kill -9.

    With -o pid= the ps header is supressed, and the output is only the pid list. As far as I know, Debian shell is POSIX compliant.

提交回复
热议问题