Jan 312015
 

For Linux administrators, slay is a convenient tool to kill all processes belonging to a user.

Slay comes in handy under various situations.

For instance, as an administrator you notice a particular user running processes he is not permitted to.

Or your room-mate is downloading a huge file or doing something else in the background that’s hogging a lot of system resources.

Maybe you’re looking to delete a user but find that he still has lot of processes running.

There could be any number of reasons to use slay.

We owe thanks to Chris Ausbrooks for first writing this shell script. Subsequently, Pawel Wiecek rewrote this for Debian.

You should be able to find slay in the official repositories of major distributions.

Installing Slay

Installing slay is easy as pie.

On Ubuntu and its derivative distributions like LinuxMint, just run the below command:

sudo apt-get install slay

If you’re running Fedora, CentOS or RedHat, use the below command:

sudo yum install slay

No, we haven’t forgotten users of Arch Linux and its derivatives. Go with the below command to install slay on your system:

sudo pacman -S slay

Using Slay

Here’s the syntax for slay:

slay [-signal] name [name…]

When you run the slay command, it sends the signal (KILL by default) to all processes belonging to a particular user or group of users.

When you use -clean as a signal name, a “clean kill” is done. In other words, processes are first sent TERM signal and after 10 seconds those processes that haven’t terminated yet are killed with KILL.

Here’s an example of using slay for all processes belonging to user jason:

$ sudo slay jason
slay: Done.

In the example, all processes belonging to user jason are terminated.

Go ahead, install slay on your system and familiarize yourself with this useful tool.

Slay Related Commands:
TCPKill – When only the Nuclear OPtion will do
 Posted by at 11:08 am

Sorry, the comment form is closed at this time.