• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

kill: command not found

by admin

Different commands are used to send signals to processes to terminate or “kill” them. This is necessary when a process becomes unresponsive (hangs), causes system instability, or fails to relinquish control over a file you’re trying to modify.

The “kill” command sends any specified signal, or by default the termination signal, to one or more processes. The PID must be specified as the argument.

The following are some examples of implementing kill signals. To terminate a process with ID 921 gracefully:

# kill 15 921

Failing that, to kill the process immediately:

# kill 9 921

Alternatively, to pause rather than remove the process entirely:

# kill 17 921

If you encounter the below error while running the kill command:

kill: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install procps
Ubuntu apt-get install procps
Alpine apk add procps
Arch Linux pacman -S procps-ng
Kali Linux apt-get install procps
CentOS yum install procps-ng
Fedora dnf install procps-ng
Raspbian apt-get install procps

kill Command Examples

1. To get the list of signals:

# kill -l 
 1) SIGHUP	 2) SIGINT	     3) SIGQUIT	 4) SIGILL
 5) SIGTRAP	 6) SIGABRT	     7) SIGEMT	 8) SIGFPE
 9) SIGKILL	10) SIGBUS	    11) SIGSEGV	12) SIGSYS
13) SIGPIPE	14) SIGALRM	    15) SIGTERM	16) SIGURG
17) SIGSTOP	18) SIGTSTP	    19) SIGCONT	20) SIGCHLD
21) SIGTTIN	22) SIGTTOU	    23) SIGIO	24) SIGXCPU
25) SIGXFSZ	26) SIGVTALRM	27) SIGPROF	28) SIGWINCH
29) SIGINFO	30) SIGUSR1	    31) SIGUSR2

2. To send a particular signal:

# kill -s 9 

3. To specify the list of processes for kill:

# kill 1234 2345 3456 

4. Terminate a program using the default SIGTERM (terminate) signal:

# kill process_id

5. Terminate a background job:

# kill %job_id

6. Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:

# kill -1|HUP process_id

7. Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`:

# kill -2|INT process_id

8. Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):

# kill -9|KILL process_id

9. Signal the operating system to pause a program until a SIGCONT (“continue”) signal is received:

# kill -17|STOP process_id

10. Send a `SIGUSR1` signal to all processes with the given GID (group id):

# kill -SIGUSR1 -group_id

Filed Under: Linux

Some more articles you might also be interested in …

  1. pi Command Examples in Linux
  2. “BAD PASSWD : is too simple” – error during password change in CentOS/RHEL 7 and 8
  3. lsusb Command Examples in Linux
  4. How To Configure sssd To Work With Multiple Active Directory Domains in Different Forests (CentOS/RHEL)
  5. How to Create a New Directory in Linux
  6. How to uninstall chillispot software package in Ubuntu
  7. Yum Command Fails with “Another app is currently holding the yum lock” in CentOS/ RHEL 7
  8. nice: command not found
  9. “docker dead but subsys locked” – error while starting docker
  10. cradle: The Cradle PHP framework (Command Examples)

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright