The “killall” command in Linux and Unix is used to kill processes by name. It sends a signal to all processes running the specified command name.
Here are some examples of how to use the “killall” command:
- To kill a process by name, use the following command:
killall <processname>
Replace “<processname>” with the name of the process that you want to kill.
- To send a specific signal to a process, use the “-s” option followed by the signal number or name:
killall -s <signal> <processname>
Replace “<signal>” with the number or name of the signal that you want to send, and “<processname>” with the name of the process that you want to kill. For example, to send the SIGKILL signal to a process named “firefox”, use the following command:
killall -s SIGKILL firefox
- To display a message before killing a process, use the “-i” option:
killall -i <processname>
This will display a prompt asking for confirmation before killing the specified process.
- To display the process IDs of the processes being killed, use the “-v” option:
killall -v <processname>
Note that the “killall” command should be used with caution, as it can kill multiple processes with the same name. It is always a good idea to verify the process name and PID before using the “killall” command.