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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pkill: command not found

by admin

pkill command sends any specified signal, or by default the termination signal, to processes based on a matching pattern. Similar to the pgrep command, but actually sends a signal instead of printing to stdout. For example, if you start top in one terminal, and then issue pkill top in another terminal, you’ll see that top terminates. The command matched a name pattern rather than a process ID.

Syntax

The syntax of this command is:

# pkill [options] {pattern}

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

pkill: 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

pkill Command Examples

1. Kill all processes which match:

# pkill "process_name"

2. Kill all processes which match their full command instead of just the process name:

# pkill -f "command_name"

3. Force kill matching processes (can’t be blocked):

# pkill -9 "process_name"

4. Send SIGUSR1 signal to processes which match:

# pkill -USR1 "process_name"

5. Kill the main `firefox` process to close the browser:

# pkill --oldest "firefox"

Filed Under: Linux

Some more articles you might also be interested in …

  1. Linux OS Service ‘nfslock’
  2. How to Audit File Access on Linux
  3. How to Verify a Lun is in Active/Optimized Mode when ALUA Is Configured on Storage
  4. qm create Command Examples in Linux
  5. chpasswd : command not found
  6. CentOS / RHEL : Resize (reduce) non-root EXT3/4 filesystem on non-LVM device (hard disk partition)
  7. CentOS / RHEL 7 : How to modify the kernel command line
  8. “az storage entity” Command Examples
  9. Linux OS Service ‘sendmail’
  10. What are Reserved User Accounts in MySQL

You May Also Like

Primary Sidebar

Recent Posts

  • cronic: Bash script for wrapping cron jobs to prevent excess email sending
  • croc: Send and receive files easily and securely over any network
  • crictl: Command-line for CRI-compatible container runtimes
  • createdb: Create a PostgreSQL database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright