What is the purpose of 'killall' and 'pkill' commands?

0248

The killall and pkill commands are used to terminate processes in Linux by their name rather than by their Process ID (PID).

  • killall: This command kills all processes that match the exact name provided. It requires an exact match of the process name.

    Example:

    killall nginx
  • pkill: This command allows for more flexible pattern matching, meaning you can use partial names or regular expressions to match processes.

    Example:

    pkill firefox

Both commands may require root privileges (using sudo) for system processes. They are particularly useful for managing multiple instances of the same program efficiently.

0 Comments

no data
Be the first to share your comment!