Steps to Kill a Running Process in Ubuntu Linux


In order to kill a running process on Ubuntu Linux, you can make use of the kill or command.


Step 1: Identify the PID (Process ID) for the running process to be killed.

% ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 09:04 pts/0    00:00:00 /bin/bash
root       244     1  0 09:06 pts/0    00:00:00 sh
root       250   244  0 09:07 pts/0    00:00:00 bash
root       440   250  0 10:14 pts/0    00:00:00 sh
root       449   440  0 11:35 pts/0    00:00:00 ps -ef

Step 2: Execute the kill command

% kill -9 440

killed!

Step 3: Verify that the running process is killed!

# ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 09:04 pts/0    00:00:00 /bin/bash
root       244     1  0 09:06 pts/0    00:00:00 sh
root       250   244  0 09:07 pts/0    00:00:00 bash
root       450   250  0 11:38 pts/0    00:00:00 ps -ef
How to kill a Running Process in Ubuntu Linux

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright ยฉ Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap