How to terminate a running process in Linux?

Asked 15-Apr-2022
Viewed 394 times

1 Answer


0

How to terminate a running process in Linux?
  • When you run an application, it starts a background process. You can kill the process associated with this application to force it to shut.
  • To kill a process, you must first get its process ID (PID). The next section explains how to locate a program's process ID.
  • Determine the program's process ID (PID).
  • There are numerous methods for determining a process's PID.
  • pidof program name>
  • To find the name of the software, use the tab completion feature. This command has the advantage of displaying the PID of all processes started by the application.
  • Use the following command to stop the process after you know the PID of the target application:
  • sudo kill -9 process_id
  • If you have many process ids, you can kill them all at once by providing all of the PIDs.
  • sudo kill -9 process_id_1 process_id_2 process_id_3
  • You can also use the kill and pidof commands together to kill all of a program's processes.
  • sudo kill -9 `pidof programe_name` 
  • Naturally, you must replace program name with the name of the programme you wish to terminate.


Read More: What are the pros/cons of the Android operating system?