Forrest logo
back to the kill tool

pidof:tldr:87045

pidof: Kill all processes with given name.
$ kill $(pidof ${name})
try on your machine

The command "kill $(pidof ${name})" is used to terminate a process or program with a specific name.

Here's a breakdown of the command:

  • "pidof" is a command that is used to find the process ID (PID) of a running program or process based on its name.
  • "${name}" is a variable that represents the name of the process or program you want to terminate.

So, the command "pidof ${name}" finds the PID of the process with the specified name, and the output of this command is passed as an argument to the "kill" command.

  • "kill" is a command that sends a signal to a process, causing it to terminate. By default, the signal sent is SIGTERM, which allows the process to gracefully exit. If this signal is not handled by the process, a SIGKILL signal can be sent to forcefully terminate it.

Putting it all together, "kill $(pidof ${name})" finds the PID of the process with the specified name and then sends a signal to that process, causing it to terminate.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the kill tool