• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Kill Process in Linux Ubuntu By PID Or Name

How To Kill Process in Linux Ubuntu By PID Or Name

By Sourabh / April 6, 2020 Category: How To, Ubuntu

Kill process in Linux by name or pid. Kill process in Ubuntu by name or pid via Terminal (command line). Kill unresponsive applications in Linux Ubuntu using “Kill” command. Kill Linux process by name or PID. How to use Linux Kill command. Tutorial on Kill command in Linux Ubuntu with example.

Kill command can be used to kill or terminate a process using “Signal” or “PID.” The command kill sends the specified signal to the specified processes or process groups. If no signal is specified, the TERM signal is sent. This TERM signal will kill processes that do not catch it; for other processes it may be necessary to use the KILL signal (number 9), since this signal cannot be caught.

 

kill-man-ubuntu-01

For a kill command a Signal Name could be any of the following:

Signal Name Signal Value Behaviour

SIGHUP 1 Hangup
SIGKILL 9 Kill Signal
SIGTERM 15 Terminate

The SIGTERM is the default and safest way to kill a process as it terminates the process.

kill -9 -1 Kill all processes you can kill.

Below is the format of the Kill command:

kill [ -signal | -s signal ] pid …

The most easiest way to kill a process is to find the PID of the resource and then run the PID as arguement with the kill command.

What is a PID?

Each Linux or Unix process or a running program is automatically assigned a unique process identification number (PID). A PID is automatically assigned number to each process on the system.

you can find PID of a resource using the “pidof” or “ps” command. To find out PID of a process (say firefox), use the following command:


pidof firefox

You can also use the command in other form:


ps -A | grep -i firefox

 

PID-Ubuntu-03

In the above output, the number “2393” is the PID of process of firefox. Once the PID of a process (firefox) is known, you can use the kill command to kill the process (firefox) as shown below.


kill 2393

When the kill command is executed, it sends a signal to a process whose PID is passed along with the command as argument.

To be more specific, the Kill command has the following forms:

kill [signal] PID
kill -15 PID
kill -9 PID
kill -SIGTERM PID
kill [options] -SIGTERM PID

 

kill-example

The Kill command has the following return codes:

  • 0 success
  • 1 failure
  • 64 partial success (when more than one process specified)

Please note that there are few rules to use Kill command:

  • You can kill all your own process.
  • Only root user can kill system level process or process started by other users.

For X server, there is another command called xkill which can kill a process. The xkill command runs from its X window without passing process name or its PID.

Tags: Find Process Number in Linux, Force Kill Process Linux, How To Find PID of Linux Command, How To Kill Process in Linux Ubuntu By Name, How To Kill Process in Linux Ubuntu By PID, How To Use Kill Command, Kill -9 Command, Kill A Process In Unix Command, Kill Command In Linux Ubuntu With Example, Kill Command In Linux With Example, Kill Command Linux, Kill Command Ubuntu, Kill Linux Process By Name, Kill Linux Process That Won't Die, Kill Process in Ubuntu, Kill SIGTERM Command, Kill Unresponsive Apps or Process in Linux, Kill Unresponsive Program in Ubuntu, Linux Command Kill Tutorial, Linux Kill Command, List Processes Linux, Ubuntu - How To Kill Process By Name, Ubuntu - How To Kill Process By PID, Ubuntu Kill Command

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap