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

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 6 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
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.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum