Middle
How to find and kill a process in Linux?
sobes.tech AI
Answer from AI
To find and kill a process in Linux, you can use the following commands:
- Find a process by name:
ps aux | grep process_name
- Find a process and get its PID using the
pidofcommand:
pidof process_name
- Kill a process by PID:
kill PID
If the process does not terminate, you can use forceful termination:
kill -9 PID
- You can also use the
pkillcommand to find and kill a process by name:
pkill process_name
Example:
pkill -9 firefox
This will terminate all processes named firefox.