Kill Processes in Linux using Fkill

Fkill is a versatile and user-friendly command-line tool that simplifies the process of managing and terminating processes on Linux systems. Its intuitive interactive interface enables efficient process management and system troubleshooting.

One of the unique features of Fkill is its ability to terminate processes by their name, Process ID (PID), or port number. This flexibility helps identify and terminate stubborn processes that refuse to close, resulting in improved system performance.

Installation

Fkill is installed via npm (Node.js package manager). Use the following command:

sudo npm install -g fkill-cli

The installation will display output similar to this:

[sudo] password for username: 
/usr/bin/fkill -> /usr/lib/node_modules/fkill-cli/index.js
/usr/lib/node_modules/fkill-cli
??? cli-spinners@2.5.0
??? columnify@1.5.4
??? inquirer@8.2.0
??? meow@9.0.0
??? supports-color@8.0.0
+ fkill-cli@7.0.2
updated 1 package in 5.376s

How It Works

After installation, running fkill opens an interactive display showing all running processes. Use arrow keys to navigate through the list, spacebar to select processes, and Enter to terminate selected processes. Multiple processes can be selected by pressing spacebar repeatedly.

Examples

Kill a Single Process by Name

To terminate a specific process like Firefox:

fkill firefox
? Killed process with PID 1234 (firefox)

Kill Multiple Processes

Multiple processes can be terminated simultaneously:

fkill chrome firefox
? Process to kill:  (Use arrow keys)
? chrome
  firefox
  [pid: 1234] node /path/to/script.js
Killed 2 processes

Kill Processes by Port Number

To terminate a process running on a specific port:

fkill :3000
? Select processes to kill with spacebar (a=all, i=invert, o=select by pid, p=select by port number)
? [1] node  (PID: 2259)
   /home/user/project/app.js
   port: 3000
? Confirm kill signal for [1] node (PID: 2259) with SIGTERM signal? (y/n)
y
Success: Killed 1 process(es) on port(s) 3000.

Interactive Mode

Running fkill without arguments opens interactive mode with a searchable list of all processes:

fkill

This displays a filterable list where you can type to search, select with spacebar, and confirm with Enter.

Key Features

Feature Description
Interactive Mode Browse and select processes visually
Process Name Kill processes by executable name
Port-based Killing Terminate processes using specific ports
Multiple Selection Kill several processes simultaneously
Cross-platform Works on Linux, macOS, and Windows

Safety Considerations

Exercise caution when using Fkill, especially when terminating system processes. Always:

  • Save important work before killing processes

  • Verify the process name/PID before termination

  • Avoid killing critical system processes

  • Use port-based killing for precision when multiple instances exist

Conclusion

Fkill is an excellent tool for process management in Linux environments, offering both interactive and command-line modes. Its ability to target processes by name, PID, or port makes it versatile for various system administration tasks. With proper caution, Fkill significantly simplifies process management and troubleshooting workflows.

Updated on: 2026-03-17T09:01:39+05:30

988 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements