Almost all UNIX SystemV version has killall command which is used to kill all active processes i.e. terminates all processes with open files so that the mounted file systems will be unbusied and can be unmounted.


However Linux killall command used to kill processes by name (if no signal name is specified, SIGTERM is sent). If you missed old good SysV killall command, try killall5 command under any Linux distro. killall5 is nothing but the UNIX SystemV killall command. It sends a signal to all processes except kernel threads and the processes in its own session, so it wonÒ€ℒt kill the shell that is running the script it was called from.

Just type killall5 and every active process will get killed except your login session:
# netstat
# netstat -tulpn
# killall5
# netstat -tulpn

As usual,
(a) The killall command can be run only by the super-user.
(b) Use this command with caution

πŸ₯Ί Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🀠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

6 comments… add one
  • weedjoint Jan 6, 2011 @ 14:21

    It kills all sessions unlike what you are telling here.
    Please try it out before you serve it for others; saves trouble this way!

    • Nishant Dec 20, 2012 @ 3:43

      Thats true. It kills current session as well.

  • Renz Jan 19, 2013 @ 13:52

    fuck you dude, your guide is inorrect

    its kill all even ssh

  • Pradeep May 23, 2013 @ 15:00

    this will leave your current session alive.

    killall5 -9

  • John Nov 19, 2013 @ 16:06

    Ugh…I should have read the comments before trying this command.

    It kills everything, desktop included.

  • Brian Feb 20, 2014 @ 21:57

    This is VERY VERY WRONG, why is this still up?

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.