Open In App

Easy way to kill process using Fkill in Linux

Last Updated : 08 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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 on Different OS.

Now let’s see how we can install the fkill on systems. The requirement to install fkill is NodeJS and npm, so first, we need to install the nodejs. Use one of the following commands to install NodeJS according to your OS:

For Debian/Ubuntu:

sudo apt-get install nodejs npm

For Arch Linux:

sudo pacman -S nodejs npm

For Fedora / Red Hat 8,9

sudo dnf install nodejs npm

For OSX

sudo brew install nodejs npm

For Windows

Open command prompt or powershell of windows with administratie privileges. 

Run the following command:

curl -o nodejs.msi https://nodejs.org/dist/v14.17.0/node-v14.17.0-x64.msi

This will install a 64-bit version of Node.js, if you want to change it you can refer to the official site to pick up the links for download according to your requirement. 

Now run the nodejs installer from cli

msiexec /i nodejs.msi /qn

Here `/qn` will run the installer silently without showing the GUI interface, to see the GUI installer interface, just run the same command without `/qn`

Installing of fkill in Linux (Ubuntu)

1) Installing nodejs and npm

sudo apt install nodejs npm

sudo apt install nodejs npm

2) Installing the fkill using npm use -g option with npm command which install fkill globally.

sudo npm install -g fkill-cli
sudo npm install -g fkill-cli

sudo npm install -g fkill-cli

3) To see the usage and options

Use fkill -h 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.

fkill -h
fkill -h

fkill -h

How to use 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.

fkill PID

Example:

fkill 19467

How to Terminate a Process (pkill) using process name.

If you want to kill the process using the process name, then mention the process name after the fkill command:

fkill process_name

Example:

fkill vim

How to 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:

fkill :3000

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.

fkill --help
fkill --help

fkill –help

Conclusion

fkill-cli is a useful command line tool that allows users to kill processes interactively. This article provides clear instructions for how we can install nodejs and npm on various operating systems and also the installation of fkill globally using npm. We have also discussed about how to kill process running on a specific port and how to kill a process with process name, port and using PIDs.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads