ℹ️ 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 | 2.4 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://medium.com/@marketing_864/how-to-kill-process-in-unix-linux-299b4683df76 |
| Last Crawled | 2026-02-07 05:08:28 (2 months ago) |
| First Indexed | not set |
| HTTP Status Code | 200 |
| Meta Title | How to kill process in Unix/Linux? | by Ram Lakshmanan | Medium |
| Meta Description | How to kill process in Unix/Linux? There are different options to terminate a process in Unix/Linux flavour of operating systems. This article intends to list down those options. kill You can use the … |
| Meta Canonical | null |
| Boilerpipe Text | 4 min read
Jan 6, 2021
--
There are different options to terminate a process in Unix/Linux flavour of operating systems. This article intends to list down those options.
kill
You can use the ‘kill’ command to terminate a process by passing the ‘process id’.
kill {PID}
PID — is the ‘process Id’ of the process that you want to terminate. If you are not sure how to find ‘process Id’,
refer to this article
.
Example:
Suppose if you want to kill a process whose ‘process Id’ is 1692 then command would be:
kill 1692
Sometimes when you issue the ‘kill’ command you may get an ‘operation not permitted’ error message. In those circumstances, issue kill command with ‘-9’ signal. i.e.
kill -9 {PID}
kill -9 1692
If you continue to get an ‘operation not permitted’ error message even with ‘kill -9’ signal then you may not have sufficient permission to terminate the process. Then you need to ‘sudo’ as a ‘root’ user (i.e. login as a super user) and then issue the ‘kill -9’ command.
NOTE:
This is the same as the ‘run as administrator’ option in Windows.
Press enter or click to view image in full size
Fig:
Terminating the process with ‘kill -9’ signal
killall
‘killall’ command is another option to terminate multiple processes in one stroke. You can use this option to kill processes based on their names, users who launched them. Let’s explore all ‘killall’ options in this section.
a. killall process_name
: Kill processes that match the specified process name.
killall {ProcessName}
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
Press enter or click to view image in full size
Fig: killall processname
NOTE:
Say if 3 processes are running with the name ‘java’, then when you use ‘killall’, all the 3 processes will be terminated.
b. killall -I process_name
: Ignore case when trying to find the process name.
killall -I {ProcessName}
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, but if you are not sure about the case sensitivity of the process, then you can use ‘-l’ option:
killall -I JAVA
c. killall -i process_name
: Ask for additional confirmation when killing the process.
killall -i {ProcessName}
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, it needs to ask for confirmation, then command would be:
Press enter or click to view image in full size
Fig: Killall Confirmation
d. killall -u username:
It kills processes owned by a specific user.
killall -u {UserName}
Suppose if you want to kill all the Process owned by the username ‘ec2-dev’, then command would be:
killall -u ec2-dev
e. killall -v process_name
: Report back on whether the process has been successfully killed.
killall -v {ProcessName}
Suppose if you want to kill the Process whose ‘process name’ is ‘java’ and you wanted to know whether the process is successfully killed, then command would be:
Press enter or click to view image in full size
Fig: Process Killed Reported
pkill
You can use ‘pkill’ command to terminate process(es) by sending a fullname or partial name of the process. By default pkill will send the signal SIGTERM.
pkill {ProcessName}
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
pkill java
Difference between ‘killall’ and ‘pkill’
‘killall’ will look for the exact match of the process name whereas the ‘pkill’ will allow to terminate the process either by full name or partial process name.
EXAMPLE:
There is a process with the name ‘java’. If you try to terminate the process using ‘killall’ command by giving partial name i.e. ‘ava’ then you will get ‘no process found’ error:
Press enter or click to view image in full size
Fig. killall using partial process name
On the other hand if you try to terminate the process using ‘pkill’ command by giving partial name i.e., ‘ava’, it will succeed:
Press enter or click to view image in full size
Fig. pkill using partial process name
top
You can also terminate a process using the popular system monitoring tool — ‘top’. Below are the steps to terminate a process in ‘top’:
1. Press ‘k’ key when top command is running
2. It will ask you to enter the Process Id which you want to terminate
3. Type the Process Id
4. Then it will ask you the signal you want to use for killing the Process
5. Type ‘9’ which is a SIGKILL. By default the signal will be SIGTERM (‘15’). If you would like to know the difference between SIGKILL and SIGTERM, refer to the below section (‘Difference between SIGTERM, SIGKILL’) in this article.
6. press enter
Press enter or click to view image in full size
Fig: killed using SIGKILL signal |
| Markdown | [Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40marketing_864%2Fhow-to-kill-process-in-unix-linux-299b4683df76&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[Medium Logo](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40marketing_864%2Fhow-to-kill-process-in-unix-linux-299b4683df76&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

# [How to kill process in Unix/Linux?](https://blog.ycrash.io/2020/12/30/how-to-kill-process-in-unix-linux/)
[](https://medium.com/@marketing_864?source=post_page---byline--299b4683df76---------------------------------------)
[Ram Lakshmanan](https://medium.com/@marketing_864?source=post_page---byline--299b4683df76---------------------------------------)
4 min read
·
Jan 6, 2021
\--
1
Listen
Share
There are different options to terminate a process in Unix/Linux flavour of operating systems. This article intends to list down those options.
## kill
You can use the ‘kill’ command to terminate a process by passing the ‘process id’.
```
kill {PID}
```
PID — is the ‘process Id’ of the process that you want to terminate. If you are not sure how to find ‘process Id’, [refer to this article](https://blog.ycrash.io/2020/12/28/how-to-find-process-id-in-unix-linux/).
Example:
Suppose if you want to kill a process whose ‘process Id’ is 1692 then command would be:
```
kill 1692
```
Sometimes when you issue the ‘kill’ command you may get an ‘operation not permitted’ error message. In those circumstances, issue kill command with ‘-9’ signal. i.e.
```
kill -9 {PID}kill -9 1692
```
If you continue to get an ‘operation not permitted’ error message even with ‘kill -9’ signal then you may not have sufficient permission to terminate the process. Then you need to ‘sudo’ as a ‘root’ user (i.e. login as a super user) and then issue the ‘kill -9’ command.
**NOTE:** This is the same as the ‘run as administrator’ option in Windows.
Press enter or click to view image in full size
![]()
***Fig:* *Terminating the process with ‘kill -9’ signal***
## killall
‘killall’ command is another option to terminate multiple processes in one stroke. You can use this option to kill processes based on their names, users who launched them. Let’s explore all ‘killall’ options in this section.
**a. killall process\_name**: Kill processes that match the specified process name.
```
killall {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
Press enter or click to view image in full size
![]()
***Fig: killall processname***
**NOTE:** Say if 3 processes are running with the name ‘java’, then when you use ‘killall’, all the 3 processes will be terminated.
**b. killall -I process\_name**: Ignore case when trying to find the process name.
```
killall -I {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, but if you are not sure about the case sensitivity of the process, then you can use ‘-l’ option:
```
killall -I JAVA
```
**c. killall -i process\_name**: Ask for additional confirmation when killing the process.
```
killall -i {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, it needs to ask for confirmation, then command would be:
Press enter or click to view image in full size
![]()
***Fig: Killall Confirmation***
**d. killall -u username:** It kills processes owned by a specific user.
```
killall -u {UserName}
```
Suppose if you want to kill all the Process owned by the username ‘ec2-dev’, then command would be:
```
killall -u ec2-dev
```
**e. killall -v process\_name**: Report back on whether the process has been successfully killed.
```
killall -v {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’ and you wanted to know whether the process is successfully killed, then command would be:
Press enter or click to view image in full size
![]()
***Fig: Process Killed Reported***
## pkill
You can use ‘pkill’ command to terminate process(es) by sending a fullname or partial name of the process. By default pkill will send the signal SIGTERM.
```
pkill {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
```
pkill java
```
Difference between ‘killall’ and ‘pkill’
‘killall’ will look for the exact match of the process name whereas the ‘pkill’ will allow to terminate the process either by full name or partial process name.
**EXAMPLE:** There is a process with the name ‘java’. If you try to terminate the process using ‘killall’ command by giving partial name i.e. ‘ava’ then you will get ‘no process found’ error:
Press enter or click to view image in full size
![]()
***Fig. killall using partial process name***
On the other hand if you try to terminate the process using ‘pkill’ command by giving partial name i.e., ‘ava’, it will succeed:
Press enter or click to view image in full size
![]()
***Fig. pkill using partial process name***
## top
You can also terminate a process using the popular system monitoring tool — ‘top’. Below are the steps to terminate a process in ‘top’:
1\. Press ‘k’ key when top command is running
2\. It will ask you to enter the Process Id which you want to terminate
3\. Type the Process Id
4\. Then it will ask you the signal you want to use for killing the Process
5\. Type ‘9’ which is a SIGKILL. By default the signal will be SIGTERM (‘15’). If you would like to know the difference between SIGKILL and SIGTERM, refer to the below section (‘Difference between SIGTERM, SIGKILL’) in this article.
6\. press enter
Press enter or click to view image in full size
![]()
**Fig: killed using SIGKILL signal**
[Java](https://medium.com/tag/java?source=post_page-----299b4683df76---------------------------------------)
\--
\--
1
[](https://medium.com/@marketing_864?source=post_page---post_author_info--299b4683df76---------------------------------------)
[](https://medium.com/@marketing_864?source=post_page---post_author_info--299b4683df76---------------------------------------)
[Written by Ram Lakshmanan](https://medium.com/@marketing_864?source=post_page---post_author_info--299b4683df76---------------------------------------)
[18 followers](https://medium.com/@marketing_864/followers?source=post_page---post_author_info--299b4683df76---------------------------------------)
·[1 following](https://medium.com/@marketing_864/following?source=post_page---post_author_info--299b4683df76---------------------------------------)
Every single day, millions & millions of people in North America — bank, travel, and commerce — use the applications that Ram Lakshmanan has architected.
## Responses (1)
See all responses
[Help](https://help.medium.com/hc/en-us?source=post_page-----299b4683df76---------------------------------------)
[Status](https://status.medium.com/?source=post_page-----299b4683df76---------------------------------------)
[About](https://medium.com/about?autoplay=1&source=post_page-----299b4683df76---------------------------------------)
[Careers](https://medium.com/jobs-at-medium/work-at-medium-959d1a85284e?source=post_page-----299b4683df76---------------------------------------)
[Press](mailto:pressinquiries@medium.com)
[Blog](https://blog.medium.com/?source=post_page-----299b4683df76---------------------------------------)
[Privacy](https://policy.medium.com/medium-privacy-policy-f03bf92035c9?source=post_page-----299b4683df76---------------------------------------)
[Rules](https://policy.medium.com/medium-rules-30e5502c4eb4?source=post_page-----299b4683df76---------------------------------------)
[Terms](https://policy.medium.com/medium-terms-of-service-9db0094a1e0f?source=post_page-----299b4683df76---------------------------------------)
[Text to speech](https://speechify.com/medium?source=post_page-----299b4683df76---------------------------------------) |
| Readable Markdown | [](https://medium.com/@marketing_864?source=post_page---byline--299b4683df76---------------------------------------)
4 min read Jan 6, 2021
\--
There are different options to terminate a process in Unix/Linux flavour of operating systems. This article intends to list down those options.
## kill
You can use the ‘kill’ command to terminate a process by passing the ‘process id’.
```
kill {PID}
```
PID — is the ‘process Id’ of the process that you want to terminate. If you are not sure how to find ‘process Id’, [refer to this article](https://blog.ycrash.io/2020/12/28/how-to-find-process-id-in-unix-linux/).
Example:
Suppose if you want to kill a process whose ‘process Id’ is 1692 then command would be:
```
kill 1692
```
Sometimes when you issue the ‘kill’ command you may get an ‘operation not permitted’ error message. In those circumstances, issue kill command with ‘-9’ signal. i.e.
```
kill -9 {PID}kill -9 1692
```
If you continue to get an ‘operation not permitted’ error message even with ‘kill -9’ signal then you may not have sufficient permission to terminate the process. Then you need to ‘sudo’ as a ‘root’ user (i.e. login as a super user) and then issue the ‘kill -9’ command.
**NOTE:** This is the same as the ‘run as administrator’ option in Windows.
Press enter or click to view image in full size
***Fig:* *Terminating the process with ‘kill -9’ signal***
## killall
‘killall’ command is another option to terminate multiple processes in one stroke. You can use this option to kill processes based on their names, users who launched them. Let’s explore all ‘killall’ options in this section.
**a. killall process\_name**: Kill processes that match the specified process name.
```
killall {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
Press enter or click to view image in full size
***Fig: killall processname***
**NOTE:** Say if 3 processes are running with the name ‘java’, then when you use ‘killall’, all the 3 processes will be terminated.
**b. killall -I process\_name**: Ignore case when trying to find the process name.
```
killall -I {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, but if you are not sure about the case sensitivity of the process, then you can use ‘-l’ option:
```
killall -I JAVA
```
**c. killall -i process\_name**: Ask for additional confirmation when killing the process.
```
killall -i {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, it needs to ask for confirmation, then command would be:
Press enter or click to view image in full size
***Fig: Killall Confirmation***
**d. killall -u username:** It kills processes owned by a specific user.
```
killall -u {UserName}
```
Suppose if you want to kill all the Process owned by the username ‘ec2-dev’, then command would be:
```
killall -u ec2-dev
```
**e. killall -v process\_name**: Report back on whether the process has been successfully killed.
```
killall -v {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’ and you wanted to know whether the process is successfully killed, then command would be:
Press enter or click to view image in full size
***Fig: Process Killed Reported***
## pkill
You can use ‘pkill’ command to terminate process(es) by sending a fullname or partial name of the process. By default pkill will send the signal SIGTERM.
```
pkill {ProcessName}
```
Suppose if you want to kill the Process whose ‘process name’ is ‘java’, then command would be:
```
pkill java
```
Difference between ‘killall’ and ‘pkill’
‘killall’ will look for the exact match of the process name whereas the ‘pkill’ will allow to terminate the process either by full name or partial process name.
**EXAMPLE:** There is a process with the name ‘java’. If you try to terminate the process using ‘killall’ command by giving partial name i.e. ‘ava’ then you will get ‘no process found’ error:
Press enter or click to view image in full size
***Fig. killall using partial process name***
On the other hand if you try to terminate the process using ‘pkill’ command by giving partial name i.e., ‘ava’, it will succeed:
Press enter or click to view image in full size
***Fig. pkill using partial process name***
## top
You can also terminate a process using the popular system monitoring tool — ‘top’. Below are the steps to terminate a process in ‘top’:
1\. Press ‘k’ key when top command is running
2\. It will ask you to enter the Process Id which you want to terminate
3\. Type the Process Id
4\. Then it will ask you the signal you want to use for killing the Process
5\. Type ‘9’ which is a SIGKILL. By default the signal will be SIGTERM (‘15’). If you would like to know the difference between SIGKILL and SIGTERM, refer to the below section (‘Difference between SIGTERM, SIGKILL’) in this article.
6\. press enter
Press enter or click to view image in full size
**Fig: killed using SIGKILL signal** |
| Shard | 77 (laksa) |
| Root Hash | 13179037029838926277 |
| Unparsed URL | com,medium!/@marketing_864/how-to-kill-process-in-unix-linux-299b4683df76 s443 |