ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.6 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://builtin.com/articles/kill-process-linux |
| Last Crawled | 2026-03-19 00:12:44 (18 days ago) |
| First Indexed | 2024-04-19 07:23:46 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | How to Kill a Process in Linux: Best Commands to Use | Built In |
| Meta Description | When errors occur in Linux or the system misbehaves, it’s important to understand the various ways to kill processes — here’s how to do it from the Linux command line. |
| Meta Canonical | null |
| Boilerpipe Text | In
Linux systems
, you may encounter a misbehaving or unresponsive process that requires immediate termination. In such cases, having an understanding of how to identify, assess and kill processes in Linux is invaluable. Here’s what commands to use to locate and kill a Linux process from the command line.
How to Kill a Process in Linux With kill Command
To kill a Linux process using the
kill
command, use the syntax:
kill [signal] [PID]
In this code:
[signal] is the specified signal you want to use to terminate the process.
-15
is the default signal sent when no signal is specified by the user.
[PID] is the process ID (PID) of the process you want to terminate.
A tutorial on how to kill process in Linux. | Video: HOWTECH
How to Find a Linux Process
Before killing a Linux process, you have to first locate it and identify its Process ID (
PID
). This can be done in a few different ways.
1. Locate a Process With ps Command
The
ps
command is a fundamental tool for displaying information about active processes. Let’s look at the following example:
Linux terminal ps command result. | Screenshot: Trung Thanh Le
When you type
ps
in the terminal, it displays a list of currently running processes, as you can see in the screenshot above. The columns
TTY
,
TIME
and
CMD
represent different attributes of these processes:
TTY
stands for “Teletypewriter” and refers to the terminal or console associated with the process. In
Unix-like operating systems
, each terminal session is assigned a unique
TTY
number. The
TTY
column indicates which terminal the process is connected to. If a process is not associated with a terminal, this column will display a question mark (
?
).
The
TIME
column represents the cumulative CPU time used by the process since it started. It’s typically displayed in hours, minutes and seconds. This column provides insight into how much CPU time a process has consumed during its lifetime.
CMD
stands for “command” and displays the command that was used to launch the process. This column shows the name of the executable or script associated with the process. If the command was truncated due to limited column width, an ellipsis (
...
) may be displayed at the end.
By default,
ps
provides a snapshot of processes running in the current shell session. However, with the appropriate options, such as
aux
,
ef
or
www
,
ps
 can display detailed information about all processes running on the system, including their
PID
s, CPU and memory usage and associated command. This information can be helpful in discerning which process to terminate. Here’s what each option does.
Show a List of All Processes With aux Command
aux
is a commonly used option with the
ps
command.
a
 stands for all processes (including those of other users).
u
displays detailed information about each process, including the user who owns the process, the CPU and memory usage and the command that launched the process.
x
includes processes not attached to any terminal (i.e., background processes).
Together, aux displays a comprehensive list of all processes, providing detailed information in a user-friendly format.
Show a Hierarchical List of Processes With ef Command
The option
ef
provides a full-format listing of processes.:
e
displays information about all processes, including those without a controlling terminal.
f
displays a full listing that includes additional information such as the process hierarchy (parent-child relationship) and process group ID.
ef
is commonly used to obtain a hierarchical view of processes, which can be useful for understanding the relationship between processes and their parents.
Make All Process Information Visible With www Command
www
 is specific to Berkeley Software Distribution (BSD)-based systems like FreeBSD and macOS, which isn’t commonly available in Linux distributions but still worth mentioning.
w
displays wide output, which is useful for ensuring that all columns of information are fully visible, especially for commands with long arguments.
w
is particularly helpful when viewing processes with lengthy command names or arguments.
w
is often combined with other options like
-aux
or
-ef
to ensure that the output is properly formatted and all information is visible.
2. Find a PID With pgrep Command
Another useful command for locating processes is
pgrep
. Unlike
ps
, which requires parsing its output to find specific processes,
pgrep
simplifies the process by allowing you to search for processes by name and output their respective PIDs directly. Let’s say you want to search for “chrome,” you’d type the following into the terminal:
pgrep chrome
and would get the following results:
pgrep chrome results in Linux. | Screenshot: Trung Thanh Le
pgrep
also provides options to search for processes based on criteria such as the user who owns the process, the parent
PID
 or the session ID. You can refer to the
pgrep
man page (
man pgrep
) for more information and additional examples.
3. View Running Processes With top Command
Additionally,
top
provides a dynamic overview of running processes, CPU usage, memory usage and other system metrics to monitor system resource usage in real-time.
To launch the
top
command, simply open a terminal and type
top
, then press “Enter.” This will launch the
top
command in its default mode, displaying an interactive table with system resource information. There are plugins to make the top interface look more fancy. But the default style looks like this:
Top command result in Linux. | Screenshot: Trung Thanh Le
Upon launching
top
, you’ll see a dynamic, updating interface with several sections. The header displays system-wide information, including the current time, how long the system has been running, the number of users logged in and system load averages.
Below the header, you’ll find a list of running processes. Each process is displayed on a separate line, with columns showing details such as process ID (
PID
), the user who owns the process (
USER
), process priority (
PR
), niche value (
NI
), virtual memory usage (
VIRT
), resident memory usage (
RES
), shared memory usage (
SHR
), process status (
S
), CPU usage (
%CPU
), memory usage (
%MEM
), total CPU time (
TIME+
) and the command that launched the process (
COMMAND
).
More on Software Development
How to Get the Last Element in an Array in JavaScript
How to Kill a Linux Process
Now that we know how to identify a process, we can now terminate it. For terminating a process, there are several commands to do so with their own advantages and disadvantages. Let’s have a look at them one by one.
1. Kill Command
The
kill
command is the quintessential tool for terminating processes in Linux. It sends signals to processes, requesting them to terminate gracefully. By default,
kill
sends the
SIGTERM
signal, allowing the process to perform any cleanup tasks before exiting.
Here’s how to use the
kill
command:
Identify the
PID
of the process using
ps
,
pgrep
or
top
like I showed in the previous section.
Execute the following command, replacing <PID>Â with the actual
PID
of the process:
kill
<PID>.
After executing the
kill
command, you can verify whether the process has been terminated using
ps
,
pgrep
or similar command. If the process is not listed anymore, then you know the termination was successful.
If the process does not respond to
SIGTERM
or needs to be terminated immediately, you can use the
SIGKILL
signal by specifying
-9
:
kill -9 <PID>
While
SIGKILL
guarantees termination, it doesn’t allow the process to clean up resources, potentially leading to data loss or corruption.
The kill command allows you to send various other signals to processes. Each signal has a specific purpose, such as requesting a process to terminate gracefully (
SIGTERM
), immediately terminating a process (
SIGKILL
) or interrupting a process (
SIGINT
).
Here’s how you can use the kill command to send the
SIGINT
signal to a process:
kill -INT <PID>
In this command
-INT
specifies the signal to send to the process.
-INT
is the short form for
SIGINT
. <PID> is the Process ID of the target process.
For example, let’s say you have a process with
PID 1234
that you want to interrupt (send
SIGINT
signal). You would execute the following command:
kill -INT 1234
This command sends the
SIGINT
signal to the process with
PID 1234
, which typically causes the process to interrupt its execution gracefully. Processes can handle the
SIGINT
signal by performing cleanup tasks or terminating gracefully, depending on how they are programmed.
Additionally, you can use the signal number instead of the signal name. For example,
2
is the signal number for
SIGINT
. So you can achieve the same result using:
kill -2 1234
Both forms (
-INT
or
-2
) are equivalent and will send the
SIGINT
signal to the specified process.
2. Killall Command
The
killall
command offers an alternative approach to terminating processes by allowing you to specify the process name instead of the
PID
. This can be useful when dealing with multiple instances of a process or when the
PID
is unknown.
You would use the
killall
command like the following:
Identify the name of the process to be terminated.
Execute the following command, replacing <
process_name
> with the name of the target process:
killall
<
process_name
>.
After executing the
killall
command, you can verify whether the process has been terminated using
ps
,
pgrep
, etc.
This command sends the
SIGTERM
signal to all processes with the specified name, requesting their graceful termination.
3. Pkill Command
Beyond
kill
and
killall
, there are several other commands and techniques for terminating processes in Linux. Similar to
pgrep
,
pkill
allows you to search for processes by name and terminate them.
Here’s how to use the
pkill
command to terminate a process:
Identify the name of the process to be killed.
Execute the following command and replace <
process_name
> with the name of the process to be terminated:
pkill
<
process_name
>.
After executing, you can verify whether the process has been terminated.
pkill
offers more advanced pattern matching capabilities, making it useful for targeting specific processes.
4. Systemct1 Command
If your system uses
systemd
, you can manage processes using
systemctl
. For example, to stop a service, you would use:
systemctl stop <service_name>
5. Killproc Command
Some distributions provide
killproc
as a script for stopping processes associated with a particular daemon. You can use the following command to kill a process via it’s
PID
:
killproc -p <PID>
If you want to terminate a process by its name, you can also use this command:
killproc <process_name>
6. Top Command
Using the
top
command shows an interface that lists the currently running processes and their PIDs. At the bottom of the
top
interface, there’s a command line where you can enter interactive commands to manipulate the display or change settings.Â
Press
k
to kill a process. You’ll be prompted to enter the
PID
of the process you want to kill.
More on Software Development
What Is Caching?
What Happens When You Kill a Process in Linux?
While it is essential to know how to terminate processes, it is equally crucial to understand which processes can be safely terminated without causing
system instability or data loss
. Generally, user-owned processes or non-essential system processes — like user applications, background processes or services not critical to system operation— can be safely terminated. However, terminating critical system processes or those owned by the root user can have adverse effects on system functionality and stability.Â
Terminating processes in Linux is a fundamental skill for system administrators and engineers  —  no matter what level they are. Remember to exercise caution when terminating processes, especially critical system processes, to avoid unintended consequences. With practice and experience, you can confidently manage and terminate processes to ensure the smooth operation of your Linux system.
There are several scenarios in which terminating a process may be necessary:
Unresponsive or malfunctioning processes can lead to system slowdowns or freezes, impacting overall system performance.
Misbehaving or memory-intensive processes can consume excessive system resources, affecting the performance of other applications and services. By terminating the process you are reclaiming the system resources.
Terminating processes associated with malware or unauthorized activities is essential for maintaining system security and integrity.
The primary commands used to terminate processes in Linux are:
kill
killall
Â
pkill
Each command offers different methods for identifying and terminating processes, catering to various use cases and preferences. Depending on your distribution, you can also use
systemctl
or
killproc
 to terminate a process. Understanding when and how to use these commands is essential for effective process management. |
| Markdown | [ ](https://builtin.com/)
[![Company Photo]()]()
[Can't find your company? Create a company profile.](https://builtin.com/node/add/company)
[View All Jobs](https://builtin.com/jobs)
[For Employers](https://employers.builtin.com/?utm_medium=BIReferral&utm_source=foremployers)
[Join](https://builtin.com/auth/signup?destination=%2Farticles%2Fkill-process-linux)
[Log In](https://builtin.com/auth/login?destination=%2Farticles%2Fkill-process-linux)
- [Jobs](https://builtin.com/jobs)
- [Companies](https://builtin.com/companies)
- [Remote](https://builtin.com/jobs/remote)
- [Articles](https://builtin.com/tech-topics)
- [Best Places To Work](https://builtin.com/awards/us/2026/best-places-to-work)
- [Job Application Tracker](https://builtin.com/auth/login?destination=%2Fhome%23application-tracker-section)
- [Software Engineering Perspectives](https://builtin.com/tag/software-engineering-perspectives "Software Engineering Perspectives")
- [Expert Contributors](https://builtin.com/tag/expert-contributors "Expert Contributors")
- [Software Engineering](https://builtin.com/tag/software-engineering "Software Engineering")
- \+2
- [IT Support](https://builtin.com/tag/it-support "IT Support")
- [Linux](https://builtin.com/tag/linux "Linux")
- \+4
# How to Kill a Process in Linux
When errors occur in Linux or the system misbehaves, it’s important to understand the various ways to kill processes — here’s how to do it from the Linux command line.

Written by [Trung Thanh Le](https://builtin.com/authors/trung-thanh-le)

Image: Shutterstock / Built In

UPDATED BY
[Brennan Whitfield](https://builtin.com/authors/brennan-whitfield) \| Aug 09, 2024
In [Linux systems](https://builtin.com/software-engineering-perspectives/linux), you may encounter a misbehaving or unresponsive process that requires immediate termination. In such cases, having an understanding of how to identify, assess and kill processes in Linux is invaluable. Here’s what commands to use to locate and kill a Linux process from the command line.
## How to Kill a Process in Linux With kill Command
To kill a Linux process using the `kill` command, use the syntax:
```
kill [signal] [PID]
```
In this code:
- \[signal\] is the specified signal you want to use to terminate the process. `-15` is the default signal sent when no signal is specified by the user.
- \[PID\] is the process ID (PID) of the process you want to terminate.
A tutorial on how to kill process in Linux. \| Video: HOWTECH
## How to Find a Linux Process
Before killing a Linux process, you have to first locate it and identify its Process ID (`PID`). This can be done in a few different ways.
### 1\. Locate a Process With ps Command
The `ps` command is a fundamental tool for displaying information about active processes. Let’s look at the following example:

Linux terminal ps command result. \| Screenshot: Trung Thanh Le
When you type `ps` in the terminal, it displays a list of currently running processes, as you can see in the screenshot above. The columns `TTY`, `TIME` and `CMD` represent different attributes of these processes:
- `TTY` stands for “Teletypewriter” and refers to the terminal or console associated with the process. In [Unix-like operating systems](https://builtin.com/data-science/bash-commands), each terminal session is assigned a unique `TTY` number. The `TTY` column indicates which terminal the process is connected to. If a process is not associated with a terminal, this column will display a question mark (`?`).
- The `TIME` column represents the cumulative CPU time used by the process since it started. It’s typically displayed in hours, minutes and seconds. This column provides insight into how much CPU time a process has consumed during its lifetime.
- `CMD` stands for “command” and displays the command that was used to launch the process. This column shows the name of the executable or script associated with the process. If the command was truncated due to limited column width, an ellipsis (`...`) may be displayed at the end.
By default, `ps` provides a snapshot of processes running in the current shell session. However, with the appropriate options, such as `aux`, `ef` or `www`, `ps` can display detailed information about all processes running on the system, including their `PID`s, CPU and memory usage and associated command. This information can be helpful in discerning which process to terminate. Here’s what each option does.
#### Show a List of All Processes With aux Command
`aux` is a commonly used option with the `ps` command.
- `a` stands for all processes (including those of other users).
- `u` displays detailed information about each process, including the user who owns the process, the CPU and memory usage and the command that launched the process.
- `x` includes processes not attached to any terminal (i.e., background processes).
Together, aux displays a comprehensive list of all processes, providing detailed information in a user-friendly format.
#### Show a Hierarchical List of Processes With ef Command
The option `ef` provides a full-format listing of processes.:
- `e` displays information about all processes, including those without a controlling terminal.
- `f` displays a full listing that includes additional information such as the process hierarchy (parent-child relationship) and process group ID.
`ef` is commonly used to obtain a hierarchical view of processes, which can be useful for understanding the relationship between processes and their parents.
#### Make All Process Information Visible With www Command
`www` is specific to Berkeley Software Distribution (BSD)-based systems like FreeBSD and macOS, which isn’t commonly available in Linux distributions but still worth mentioning.
- `w` displays wide output, which is useful for ensuring that all columns of information are fully visible, especially for commands with long arguments.
- `w` is particularly helpful when viewing processes with lengthy command names or arguments.
- `w` is often combined with other options like `-aux` or `-ef` to ensure that the output is properly formatted and all information is visible.
### 2\. Find a PID With pgrep Command
Another useful command for locating processes is `pgrep`. Unlike `ps`, which requires parsing its output to find specific processes, `pgrep` simplifies the process by allowing you to search for processes by name and output their respective PIDs directly. Let’s say you want to search for “chrome,” you’d type the following into the terminal: `pgrep chrome` and would get the following results:

pgrep chrome results in Linux. \| Screenshot: Trung Thanh Le
`pgrep` also provides options to search for processes based on criteria such as the user who owns the process, the parent `PID` or the session ID. You can refer to the `pgrep` man page (`man pgrep`) for more information and additional examples.
### 3\. View Running Processes With top Command
Additionally, `top` provides a dynamic overview of running processes, CPU usage, memory usage and other system metrics to monitor system resource usage in real-time.
To launch the `top` command, simply open a terminal and type `top`, then press “Enter.” This will launch the `top` command in its default mode, displaying an interactive table with system resource information. There are plugins to make the top interface look more fancy. But the default style looks like this:

Top command result in Linux. \| Screenshot: Trung Thanh Le
Upon launching `top`, you’ll see a dynamic, updating interface with several sections. The header displays system-wide information, including the current time, how long the system has been running, the number of users logged in and system load averages.
Below the header, you’ll find a list of running processes. Each process is displayed on a separate line, with columns showing details such as process ID (`PID`), the user who owns the process (`USER`), process priority (`PR`), niche value (`NI`), virtual memory usage (`VIRT`), resident memory usage (`RES`), shared memory usage (`SHR`), process status (`S`), CPU usage (`%CPU`), memory usage (`%MEM`), total CPU time (`TIME+`) and the command that launched the process (`COMMAND`).
More on Software Development[How to Get the Last Element in an Array in JavaScript](https://builtin.com/articles/javascript-get-last-element-of-array)
## How to Kill a Linux Process
Now that we know how to identify a process, we can now terminate it. For terminating a process, there are several commands to do so with their own advantages and disadvantages. Let’s have a look at them one by one.
### 1\. Kill Command
The `kill` command is the quintessential tool for terminating processes in Linux. It sends signals to processes, requesting them to terminate gracefully. By default, `kill` sends the `SIGTERM` signal, allowing the process to perform any cleanup tasks before exiting.
Here’s how to use the `kill` command:
1. Identify the `PID` of the process using `ps`, `pgrep` or `top` like I showed in the previous section.
2. Execute the following command, replacing \<PID\> with the actual `PID` of the process: `kill` \<PID\>.
3. After executing the `kill` command, you can verify whether the process has been terminated using `ps`, `pgrep` or similar command. If the process is not listed anymore, then you know the termination was successful.
If the process does not respond to `SIGTERM` or needs to be terminated immediately, you can use the `SIGKILL` signal by specifying `-9`:
```
kill -9 <PID>
```
While `SIGKILL` guarantees termination, it doesn’t allow the process to clean up resources, potentially leading to data loss or corruption.
The kill command allows you to send various other signals to processes. Each signal has a specific purpose, such as requesting a process to terminate gracefully (`SIGTERM`), immediately terminating a process (`SIGKILL`) or interrupting a process (`SIGINT`).
Here’s how you can use the kill command to send the `SIGINT` signal to a process:
#### kill -INT \<PID\>
In this command `-INT` specifies the signal to send to the process. `-INT` is the short form for `SIGINT`. \<PID\> is the Process ID of the target process.
For example, let’s say you have a process with `PID 1234` that you want to interrupt (send `SIGINT` signal). You would execute the following command:
```
kill -INT 1234
```
This command sends the `SIGINT` signal to the process with `PID 1234`, which typically causes the process to interrupt its execution gracefully. Processes can handle the `SIGINT` signal by performing cleanup tasks or terminating gracefully, depending on how they are programmed.
Additionally, you can use the signal number instead of the signal name. For example, `2` is the signal number for `SIGINT`. So you can achieve the same result using:
```
kill -2 1234
```
Both forms (`-INT` or `-2`) are equivalent and will send the `SIGINT` signal to the specified process.
### 2\. Killall Command
The `killall` command offers an alternative approach to terminating processes by allowing you to specify the process name instead of the `PID`. This can be useful when dealing with multiple instances of a process or when the `PID` is unknown.
You would use the `killall` command like the following:
1. Identify the name of the process to be terminated.
2. Execute the following command, replacing \<`process_name`\> with the name of the target process: `killall` \<`process_name`\>.
3. After executing the `killall` command, you can verify whether the process has been terminated using `ps`, `pgrep`, etc.
This command sends the `SIGTERM` signal to all processes with the specified name, requesting their graceful termination.
### 3\. Pkill Command
Beyond `kill` and `killall`, there are several other commands and techniques for terminating processes in Linux. Similar to `pgrep`, `pkill` allows you to search for processes by name and terminate them.
Here’s how to use the `pkill` command to terminate a process:
1. Identify the name of the process to be killed.
2. Execute the following command and replace \<`process_name`\> with the name of the process to be terminated: `pkill` \<`process_name`\>.
3. After executing, you can verify whether the process has been terminated.
`pkill` offers more advanced pattern matching capabilities, making it useful for targeting specific processes.
### 4\. Systemct1 Command
If your system uses `systemd`, you can manage processes using `systemctl`. For example, to stop a service, you would use:
```
systemctl stop <service_name>
```
### 5\. Killproc Command
Some distributions provide `killproc` as a script for stopping processes associated with a particular daemon. You can use the following command to kill a process via it’s `PID`:
```
killproc -p <PID>
```
If you want to terminate a process by its name, you can also use this command:
```
killproc <process_name>
```
### 6\. Top Command
Using the `top` command shows an interface that lists the currently running processes and their PIDs. At the bottom of the `top` interface, there’s a command line where you can enter interactive commands to manipulate the display or change settings.
Press `k` to kill a process. You’ll be prompted to enter the `PID` of the process you want to kill.
More on Software Development[What Is Caching?](https://builtin.com/articles/caching)
## What Happens When You Kill a Process in Linux?
While it is essential to know how to terminate processes, it is equally crucial to understand which processes can be safely terminated without causing [system instability or data loss](https://builtin.com/cybersecurity/dlp-systems-improve-personnel-security). Generally, user-owned processes or non-essential system processes — like user applications, background processes or services not critical to system operation— can be safely terminated. However, terminating critical system processes or those owned by the root user can have adverse effects on system functionality and stability.
Terminating processes in Linux is a fundamental skill for system administrators and engineers — no matter what level they are. Remember to exercise caution when terminating processes, especially critical system processes, to avoid unintended consequences. With practice and experience, you can confidently manage and terminate processes to ensure the smooth operation of your Linux system.
## Frequently Asked Questions
### Why would you need to kill a process?
There are several scenarios in which terminating a process may be necessary:
- Unresponsive or malfunctioning processes can lead to system slowdowns or freezes, impacting overall system performance.
- Misbehaving or memory-intensive processes can consume excessive system resources, affecting the performance of other applications and services. By terminating the process you are reclaiming the system resources.
- Terminating processes associated with malware or unauthorized activities is essential for maintaining system security and integrity.
### What commands kill a process in Linux?
The primary commands used to terminate processes in Linux are:
- `kill`
- `killall`
- `pkill`
Each command offers different methods for identifying and terminating processes, catering to various use cases and preferences. Depending on your distribution, you can also use `systemctl` or `killproc` to terminate a process. Understanding when and how to use these commands is essential for effective process management.
### Recent Software Engineering Perspectives Articles
[ What Would Happen If Web Scraping Were Banned?](https://builtin.com/articles/web-scraping-ban-what-ifs)
[ 101 Software Development Companies Innovating Tech](https://builtin.com/articles/software-development-companies)
[ 12 Largest Software Companie](https://builtin.com/articles/largest-software-companies)
Explore Job Matches.
Job Title or Keyword
0" type="button" class="btn btn-sm job-search-clear"\> Clear search
Location
Job Type
Clear
Apply
See Jobs
- [Jobs](https://builtin.com/jobs)
- [Companies](https://builtin.com/companies)
- [Articles](https://builtin.com/tech-topics)
- [Tracker](https://builtin.com/auth/login?destination=%2Fhome%23application-tracker-section)
- More

[Join](https://builtin.com/auth/signup?destination=%2Farticles%2Fkill-process-linux)
[Log In](https://builtin.com/auth/login?destination=%2Farticles%2Fkill-process-linux)
- [Tech Jobs](https://builtin.com/jobs)
- [Companies](https://builtin.com/companies)
- [Articles](https://builtin.com/tech-topics)
- [Remote](https://builtin.com/jobs/remote)
- [Best Places To Work](https://builtin.com/awards/us/2026/best-places-to-work)
- [Tech Hubs](https://builtin.com/tech-hubs)
[Post Job](https://employers.builtin.com/membership?utm_medium=BIReferral&utm_source=foremployers)
[](https://builtin.com/)

Built In is the online community for startups and tech companies. Find startup jobs, tech news and events.
About
[Our Story](https://builtin.com/our-story)
[Careers](https://employers.builtin.com/careers/)
[Our Staff Writers](https://builtin.com/our-staff)
[Content Descriptions](https://builtin.com/content-descriptions)
***
Get Involved
[Recruit With Built In](https://employers.builtin.com/membership?utm_medium=BIReferral&utm_source=foremployers)
[Become an Expert Contributor](https://builtin.com/expert-contributors)
***
Resources
[Customer Support](https://knowledgebase.builtin.com/s/)
[Share Feedback](https://form.jotform.com/223044927257054)
[Report a Bug](https://knowledgebase.builtin.com/s/contactsupport)
[Tech Job Tools + Career Resources](https://builtin.com/articles/grow-your-career)
[Browse Jobs](https://builtin.com/browse-jobs)
[Tech A-Z](https://builtin.com/tech-dictionary)
***
Tech Hubs
[Our Sites](https://builtin.com/our-sites)
***
[Learning Lab User Agreement](https://builtin.com/learning-lab-user-agreement) [Accessibility Statement](https://builtin.com/accessibility-statement) [Copyright Policy](https://builtin.com/copyright-policy) [Privacy Policy](https://builtin.com/privacy-policy) [Terms of Use](https://builtin.com/community-terms-of-use) [Your Privacy Choices/Cookie Settings](https://builtin.com/california-do-not-sell-my-information) [CA Notice of Collection](https://builtin.com/ca-notice-collection)
© Built In 2026 |
| Readable Markdown | In [Linux systems](https://builtin.com/software-engineering-perspectives/linux), you may encounter a misbehaving or unresponsive process that requires immediate termination. In such cases, having an understanding of how to identify, assess and kill processes in Linux is invaluable. Here’s what commands to use to locate and kill a Linux process from the command line.
## How to Kill a Process in Linux With kill Command
To kill a Linux process using the `kill` command, use the syntax:
```
kill [signal] [PID]
```
In this code:
- \[signal\] is the specified signal you want to use to terminate the process. `-15` is the default signal sent when no signal is specified by the user.
- \[PID\] is the process ID (PID) of the process you want to terminate.
A tutorial on how to kill process in Linux. \| Video: HOWTECH
## How to Find a Linux Process
Before killing a Linux process, you have to first locate it and identify its Process ID (`PID`). This can be done in a few different ways.
### 1\. Locate a Process With ps Command
The `ps` command is a fundamental tool for displaying information about active processes. Let’s look at the following example:

Linux terminal ps command result. \| Screenshot: Trung Thanh Le
When you type `ps` in the terminal, it displays a list of currently running processes, as you can see in the screenshot above. The columns `TTY`, `TIME` and `CMD` represent different attributes of these processes:
- `TTY` stands for “Teletypewriter” and refers to the terminal or console associated with the process. In [Unix-like operating systems](https://builtin.com/data-science/bash-commands), each terminal session is assigned a unique `TTY` number. The `TTY` column indicates which terminal the process is connected to. If a process is not associated with a terminal, this column will display a question mark (`?`).
- The `TIME` column represents the cumulative CPU time used by the process since it started. It’s typically displayed in hours, minutes and seconds. This column provides insight into how much CPU time a process has consumed during its lifetime.
- `CMD` stands for “command” and displays the command that was used to launch the process. This column shows the name of the executable or script associated with the process. If the command was truncated due to limited column width, an ellipsis (`...`) may be displayed at the end.
By default, `ps` provides a snapshot of processes running in the current shell session. However, with the appropriate options, such as `aux`, `ef` or `www`, `ps` can display detailed information about all processes running on the system, including their `PID`s, CPU and memory usage and associated command. This information can be helpful in discerning which process to terminate. Here’s what each option does.
#### Show a List of All Processes With aux Command
`aux` is a commonly used option with the `ps` command.
- `a` stands for all processes (including those of other users).
- `u` displays detailed information about each process, including the user who owns the process, the CPU and memory usage and the command that launched the process.
- `x` includes processes not attached to any terminal (i.e., background processes).
Together, aux displays a comprehensive list of all processes, providing detailed information in a user-friendly format.
#### Show a Hierarchical List of Processes With ef Command
The option `ef` provides a full-format listing of processes.:
- `e` displays information about all processes, including those without a controlling terminal.
- `f` displays a full listing that includes additional information such as the process hierarchy (parent-child relationship) and process group ID.
`ef` is commonly used to obtain a hierarchical view of processes, which can be useful for understanding the relationship between processes and their parents.
#### Make All Process Information Visible With www Command
`www` is specific to Berkeley Software Distribution (BSD)-based systems like FreeBSD and macOS, which isn’t commonly available in Linux distributions but still worth mentioning.
- `w` displays wide output, which is useful for ensuring that all columns of information are fully visible, especially for commands with long arguments.
- `w` is particularly helpful when viewing processes with lengthy command names or arguments.
- `w` is often combined with other options like `-aux` or `-ef` to ensure that the output is properly formatted and all information is visible.
### 2\. Find a PID With pgrep Command
Another useful command for locating processes is `pgrep`. Unlike `ps`, which requires parsing its output to find specific processes, `pgrep` simplifies the process by allowing you to search for processes by name and output their respective PIDs directly. Let’s say you want to search for “chrome,” you’d type the following into the terminal: `pgrep chrome` and would get the following results:

pgrep chrome results in Linux. \| Screenshot: Trung Thanh Le
`pgrep` also provides options to search for processes based on criteria such as the user who owns the process, the parent `PID` or the session ID. You can refer to the `pgrep` man page (`man pgrep`) for more information and additional examples.
### 3\. View Running Processes With top Command
Additionally, `top` provides a dynamic overview of running processes, CPU usage, memory usage and other system metrics to monitor system resource usage in real-time.
To launch the `top` command, simply open a terminal and type `top`, then press “Enter.” This will launch the `top` command in its default mode, displaying an interactive table with system resource information. There are plugins to make the top interface look more fancy. But the default style looks like this:

Top command result in Linux. \| Screenshot: Trung Thanh Le
Upon launching `top`, you’ll see a dynamic, updating interface with several sections. The header displays system-wide information, including the current time, how long the system has been running, the number of users logged in and system load averages.
Below the header, you’ll find a list of running processes. Each process is displayed on a separate line, with columns showing details such as process ID (`PID`), the user who owns the process (`USER`), process priority (`PR`), niche value (`NI`), virtual memory usage (`VIRT`), resident memory usage (`RES`), shared memory usage (`SHR`), process status (`S`), CPU usage (`%CPU`), memory usage (`%MEM`), total CPU time (`TIME+`) and the command that launched the process (`COMMAND`).
More on Software Development[How to Get the Last Element in an Array in JavaScript](https://builtin.com/articles/javascript-get-last-element-of-array)
## How to Kill a Linux Process
Now that we know how to identify a process, we can now terminate it. For terminating a process, there are several commands to do so with their own advantages and disadvantages. Let’s have a look at them one by one.
### 1\. Kill Command
The `kill` command is the quintessential tool for terminating processes in Linux. It sends signals to processes, requesting them to terminate gracefully. By default, `kill` sends the `SIGTERM` signal, allowing the process to perform any cleanup tasks before exiting.
Here’s how to use the `kill` command:
1. Identify the `PID` of the process using `ps`, `pgrep` or `top` like I showed in the previous section.
2. Execute the following command, replacing \<PID\> with the actual `PID` of the process: `kill` \<PID\>.
3. After executing the `kill` command, you can verify whether the process has been terminated using `ps`, `pgrep` or similar command. If the process is not listed anymore, then you know the termination was successful.
If the process does not respond to `SIGTERM` or needs to be terminated immediately, you can use the `SIGKILL` signal by specifying `-9`:
```
kill -9 <PID>
```
While `SIGKILL` guarantees termination, it doesn’t allow the process to clean up resources, potentially leading to data loss or corruption.
The kill command allows you to send various other signals to processes. Each signal has a specific purpose, such as requesting a process to terminate gracefully (`SIGTERM`), immediately terminating a process (`SIGKILL`) or interrupting a process (`SIGINT`).
Here’s how you can use the kill command to send the `SIGINT` signal to a process:
#### kill -INT \<PID\>
In this command `-INT` specifies the signal to send to the process. `-INT` is the short form for `SIGINT`. \<PID\> is the Process ID of the target process.
For example, let’s say you have a process with `PID 1234` that you want to interrupt (send `SIGINT` signal). You would execute the following command:
```
kill -INT 1234
```
This command sends the `SIGINT` signal to the process with `PID 1234`, which typically causes the process to interrupt its execution gracefully. Processes can handle the `SIGINT` signal by performing cleanup tasks or terminating gracefully, depending on how they are programmed.
Additionally, you can use the signal number instead of the signal name. For example, `2` is the signal number for `SIGINT`. So you can achieve the same result using:
```
kill -2 1234
```
Both forms (`-INT` or `-2`) are equivalent and will send the `SIGINT` signal to the specified process.
### 2\. Killall Command
The `killall` command offers an alternative approach to terminating processes by allowing you to specify the process name instead of the `PID`. This can be useful when dealing with multiple instances of a process or when the `PID` is unknown.
You would use the `killall` command like the following:
1. Identify the name of the process to be terminated.
2. Execute the following command, replacing \<`process_name`\> with the name of the target process: `killall` \<`process_name`\>.
3. After executing the `killall` command, you can verify whether the process has been terminated using `ps`, `pgrep`, etc.
This command sends the `SIGTERM` signal to all processes with the specified name, requesting their graceful termination.
### 3\. Pkill Command
Beyond `kill` and `killall`, there are several other commands and techniques for terminating processes in Linux. Similar to `pgrep`, `pkill` allows you to search for processes by name and terminate them.
Here’s how to use the `pkill` command to terminate a process:
1. Identify the name of the process to be killed.
2. Execute the following command and replace \<`process_name`\> with the name of the process to be terminated: `pkill` \<`process_name`\>.
3. After executing, you can verify whether the process has been terminated.
`pkill` offers more advanced pattern matching capabilities, making it useful for targeting specific processes.
### 4\. Systemct1 Command
If your system uses `systemd`, you can manage processes using `systemctl`. For example, to stop a service, you would use:
```
systemctl stop <service_name>
```
### 5\. Killproc Command
Some distributions provide `killproc` as a script for stopping processes associated with a particular daemon. You can use the following command to kill a process via it’s `PID`:
```
killproc -p <PID>
```
If you want to terminate a process by its name, you can also use this command:
```
killproc <process_name>
```
### 6\. Top Command
Using the `top` command shows an interface that lists the currently running processes and their PIDs. At the bottom of the `top` interface, there’s a command line where you can enter interactive commands to manipulate the display or change settings.
Press `k` to kill a process. You’ll be prompted to enter the `PID` of the process you want to kill.
More on Software Development[What Is Caching?](https://builtin.com/articles/caching)
## What Happens When You Kill a Process in Linux?
While it is essential to know how to terminate processes, it is equally crucial to understand which processes can be safely terminated without causing [system instability or data loss](https://builtin.com/cybersecurity/dlp-systems-improve-personnel-security). Generally, user-owned processes or non-essential system processes — like user applications, background processes or services not critical to system operation— can be safely terminated. However, terminating critical system processes or those owned by the root user can have adverse effects on system functionality and stability.
Terminating processes in Linux is a fundamental skill for system administrators and engineers — no matter what level they are. Remember to exercise caution when terminating processes, especially critical system processes, to avoid unintended consequences. With practice and experience, you can confidently manage and terminate processes to ensure the smooth operation of your Linux system.
There are several scenarios in which terminating a process may be necessary:
- Unresponsive or malfunctioning processes can lead to system slowdowns or freezes, impacting overall system performance.
- Misbehaving or memory-intensive processes can consume excessive system resources, affecting the performance of other applications and services. By terminating the process you are reclaiming the system resources.
- Terminating processes associated with malware or unauthorized activities is essential for maintaining system security and integrity.
The primary commands used to terminate processes in Linux are:
- `kill`
- `killall`
- `pkill`
Each command offers different methods for identifying and terminating processes, catering to various use cases and preferences. Depending on your distribution, you can also use `systemctl` or `killproc` to terminate a process. Understanding when and how to use these commands is essential for effective process management. |
| Shard | 169 (laksa) |
| Root Hash | 7607033694470393769 |
| Unparsed URL | com,builtin!/articles/kill-process-linux s443 |