+5 votes
304 views
How to kill Linux processes with fkill command

in Linux / Unix by (552k points)
reopened | 304 views

1 Answer

+3 votes
Best answer

1. Install fkill command on Linux
2. Use fkill command on Linux

Linux operating systems have a large number of processes that are created in order to optimize and allow all services to function correctly, but in some situations we can find that various processes can affect the overall performance of the system so we must proceed to "kill" these processes..

For Linux environments, we have a useful command called "fkill" and through this tutorial we will learn what it is and how to use that command in Linux.

What is fkill
Fkill-cli is a free open-source and cross-platform command line tool which has been designed to interactively kill every process that affects all tasks in Linux and has been developed using Nodejs.

Fkill works with full compatibility on macOS, Linux, and Windows operating systems..


1. Install fkill command on Linux


To start this process, we will execute one of the following commands.
Step 1

To install Nodejs and NPM on Debian / Ubuntu systems we have one of the following options:
Install Noje.js 8
 curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt install -y nodejs 
Install Noje.js 10
 curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt install -y nodejs 
Step 2

In this case we will install Node.js 10 so we first execute the following:
 curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - 
image
Step 3

Then we execute:
 sudo apt install -y nodejs 
image
Step 4

In the case of having CentOS or RedHat we will execute the following:
Install Noje.js 8
 curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - sudo yum -y install nodejs 
Install Noje.js 10
 curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - sudo yum -y install nodejs 
Step 5

Once the Nodejs and NPM packages have been installed, it will be time to install the fkill-cli package using the npm command with the -g option, which gives us the option to install it globally:
 sudo npm install -g fkill-cli 
image
Step 6

When this ends we will see the following: image

2. Use fkill command on Linux

Step 1

When the process has installed fkill-cli on Linux, we can use the fkill command in order to start it in interactive mode by executing it without any arguments.
 fkill 
image
Step 2

With the fkill command it is possible to indicate a PID or process name from the command line, this process name is not case sensitive, for example:
 fkill 1458 fkill Firefox 
image
Step 3

If we want to kill a port, we must add two points like this:
 fkill: 19999 
Step 4

It is possible to use the “-f” indicator to force an operation and “-v” gives us the option to visualize the process arguments:
 fkill -f 1458 fkill -v apache 
Step 5

To access the help of fkill we run:
 fkill –help 
image

As we can see, fkill is a simple command that gives us the option to completely eliminate processes in Linux.


by (3.5m points)
edited

Related questions

+3 votes
1 answer
+4 votes
1 answer
+5 votes
1 answer
asked Nov 2, 2019 in Linux / Unix by backtothefuture (552k points) | 278 views
+3 votes
1 answer
asked Oct 23, 2019 in Linux / Unix by backtothefuture (552k points) | 324 views
+5 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users