Easy way to kill process using Fkill in Linux
fkill-cli is a command-line-based tool to kill processes interactively. Fkill is developed using Nodejs. It can run on different operating systems like macOS, Linux, and windows. To kill the process using fkill we just have to mention the process name or the process PID. Fkill can also be used to kill port.
Installation of fkill
Now let’s see how we can install the fkill on systems. The requirement to install fkill is NodeJS, so first, we need to install the nodejs. Use one of the following commands to install NodeJS according to your OS:
apt-get install node
For Arch Linux:
pacman -S nodejs
dnf install nodejs
brew install node
Note: For window, refer to installation of Node.js on Windows.
Now we have installed the npm on our systems. Now to install the fkill use npm. NPM is a package manager for nodes. To install the fkill using npm use -g option with npm command which install fkill globally.
sudo npm install -g fkill-cli
We have installed the fkill-cli tool. Now let’s see how to use fkill.
Use fkill command to launch the fkill in interactive mode without providing any argument. Then this will show you available processes and search the process which you want to kill and then hit enter to kill or use the arrow key to select the process.
Using fkill to kill the process using PID
If you want to kill the process using PID with fkill then mention the PID after the fkill command.
Using fkill to kill the process using process name
If you want to kill the process using the process name, then mention the process name after the fkill command:
Use fkill to kill the port
If you want to kill the process running on the port, then just mention the port number with a colon (:) after the fkill command:
To forcefully kill the process, use -f option with fkill command.
fkill -f 1222
To show process arguments use the -v option with fkill command.
fkill -v firefox
To see the help message of fkill command, use the –help option with fkill command.