Linux terminologies: Process, PID and TID
A short informative guide about Processes in Linuxπ§ and how to kill them
Process...What is that?π€
- A process is an instance of one or more related tasks (threads) executing on your computer. π
- Not the same as a program or a command. β
- A single command may start several processes simultaneously.
- Some processes are independent of each other while others are related. ππ½π§ππ½
- A failure of one process may or may not affect the others running on the system.
Process Id(PID) μ:
- There are always multiple processes being executed in the background.
- The operating system keeps track of them by assigning each a unique process ID (PID) number, used to track process state, CPU usage, memory usage, etc.
Thread ID(TID) μμμμμμ:
For a multi-threaded process, each thread shares the same PID but has a unique TID.
To get a task-manager-ish view of running processesπ§π½βπΌ:
top
To kill a process (you can only kill your processes; those belonging to another user are off-limits unless you are root):
kill -SIGKILL <pid>
orkill -9 <pid>
To kill an app running in backgroundπ»:
- First, we need a PID of that app(grep works as a filter)π:
top | grep <appName>
- Now that we have a PID, we can kill that app/process ββΏβ:
kill -9 <pid of that app>
Β