LinuxCommandLibrary

skill

Send signals to processes by username

SYNOPSIS

skill [-signal] [-t tty] [-u user] [process_name|pid...]
skill [-l]
skill [-v]

PARAMETERS

-signal
    Specifies the signal to send to the selected processes. This can be a numeric signal ID (e.g., -9 for KILL) or a signal name (e.g., -HUP for SIGHUP). If no signal is specified, SIGTERM (signal 15) is sent by default.

-t tty
    Selects processes that are associated with the specified terminal (TTY). The TTY name can be provided without the /dev/ prefix (e.g., pts/0 or tty1).

-u user
    Selects processes owned by the specified user. The user can be identified by their username or numeric User ID (UID).

process_name|pid...
    Specifies the name of the process(es) to signal (e.g., httpd, firefox) or their specific Process ID(s) (PIDs). When a process name is used, skill attempts to send the signal to all running processes that match that name.

-l
    Lists all available signal names and their corresponding numbers. When this option is used, no signals are sent to processes.

-v
    Enables verbose output, causing skill to display information about which processes received the signal.

DESCRIPTION

The skill command is a utility for sending signals to processes on a Linux system. Unlike the basic kill command, which primarily targets processes by their Process ID (PID), skill provides the ability to select processes based on various criteria such as their command name, the user who owns them, or the terminal (TTY) they are attached to.

Originating from System V Unix, skill was designed to simplify process management by allowing users to terminate or manage groups of processes without needing to know each individual PID. While it is still present on some Linux distributions, its functionality has largely been superseded and improved upon by more versatile and robust commands like pkill and killall. On many modern systems, skill is often implemented as a symbolic link to pkill, reflecting its deprecated status as a standalone utility.

CAVEATS

The skill command is largely considered obsolete in modern Linux systems. Its functionality is predominantly superseded by the more robust and flexible commands pkill and killall, which offer more advanced pattern matching and selection options for processes. On many current distributions, skill is simply a symbolic link to pkill. Using skill with only a process name can be potentially dangerous if multiple, unrelated processes share the same name, as it will signal all of them indiscriminately. Users are advised to exercise caution and verify the intended target processes.

<I>MODERN ALTERNATIVES</I>

For virtually all modern use cases involving signaling processes by name, user, or other criteria, it is highly recommended to use pkill instead of skill. For example, the command skill -9 httpd is functionally identical to pkill -9 httpd, and skill -u john achieves the same result as pkill -u john. pkill generally offers more powerful options and is actively maintained.

HISTORY

The skill command originated in System V Unix, providing a means to send signals to groups of processes based on criteria beyond just PID, such as the owning user or the associated terminal. This was a significant improvement for process management at the time. However, with the evolution of Linux and the development of more sophisticated process management tools within the procps-ng suite, particularly pkill and pgrep, skill's direct usage has significantly declined. Its core functionality has been absorbed and improved upon by these newer utilities, leading to its effective deprecation.

SEE ALSO

kill(1), killall(1), pkill(1), pgrep(1)

Copied to clipboard