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 How to kill a Running Process in Ubuntu Linux](https://code2care.org/linux/steps-to-kill-a-running-process-in-ubuntu-linux/images/How to kill a Running Process in Ubuntu Linux.jpg)
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
More Posts related to Ubuntu,
- Fix - sudo: systemctl: command not found
- How to know the version of Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- How to install Apache Maven on Ubuntu
- Steps to Kill a Running Process in Ubuntu Linux
- How to know current Ubuntu Linux version via terminal command
- How to stop/start/restart apache server using command [Ubuntu]
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
- Ubuntu: How to search for a package to install using apt in Terminal
- Fix: E: Command line option --installed is not understood in combination with the other options
- How to install Python on Ubuntu
- Ubuntu Linux: How to Login as root User
- Access Windows share folder in Ubuntu Device in Network
- Add a User as a Sudoer Using Ubuntu Linux Command Line Terminal
- Install Oh My Zsh on Ubuntu Docker complete steps
- Fix: Make makefile:31 Error 127 (GCC)
- [fix] openssl No such file or directory error C++
- How to install zsh shell on Ubuntu
- Install Golang (Go) on Ubuntu
- Ubuntu Linux: Unzip a zip file using Terminal
- Where are Environment Variables stored in Ubuntu
- apt-get list --installed packages in Ubuntu Linux
- Ubuntu: List all Installed Packages using apt
- Quick steps to install Nginx on Ubuntu Linux
- How to kill service running on a port on Ubuntu Linux
More Posts:
- How to connect to Microsoft Exchange Online using PowerShell - Powershell
- AppleScript Example with TextEdit - MacOS
- How to know if you are on iOS 17 on your iPhone - iOS
- Create SharePoint Site Collection with new Content database in existing web application - SharePoint
- Check Android Studio App is M1/M2 Chip based post installation - Android-Studio
- Disable Apps from Opening on Mac Startup (Login items) - MacOS
- How to Open Notepad as Administrator on Windows 11 - Windows
- Fix: React Native Error : UncheckedIOException: Could not move temporary workspace - Gradle