How to kill user processes from the same user?

6,015

A useful tools is slay: sudo slay username If you don't run slay as root, you will end up killing off all of your processes however, rather than the specified user.

See also: https://unix.stackexchange.com/questions/18043/how-do-i-kill-all-a-users-processes-using-their-uid

Share:
6,015

Related videos on Youtube

Grey
Author by

Grey

client side developer on Android platform.

Updated on September 18, 2022

Comments

  • Grey
    Grey over 1 year

    I opened a VNC server and my VNC session is suddenly dead. I have lot of xterms open. When I ssh to the machine. and type

    users
    

    I see a bunch of users – my user accounts, like:

    userA UserA UserA UserA UserA UserA UserA
    

    I know I can use

    pkill -u usersname 
    

    Since I can only log in as userA, every time I run pkill-u UserA, it will just kill my current session. but other userAs are still there

    What can I do?

    • Renan
      Renan almost 12 years
      What is the actual question?
    • slhck
      slhck almost 12 years
      @Renan I assume he wants to kill those extra user sessions.
    • Grey
      Grey almost 12 years
      exactly. other sessions are not killed, but my current session is killed
    • Renan
      Renan almost 12 years
      @slhck That's what I assumed, too. But he edited the question for clarification.