Monitoring processes using ps
We have used the pscommand in the introduction. Let's learn more about it:
- To list the processes associated with our current Bash shell Terminal, enter the following command:
$ ps
- To list processes, along with the parent process ID associated with the current Terminal, enter the following command:
$ ps -f
- We can see the process ID in the
PIDcolumn and the parent process ID, in thePPIDcolumn in the preceding output.
- To list processes with the parent process ID along with the process state, enter the following command:
$ ps -lf
- In the preceding output, the column with
S(state) shows the current state of a process, such asRfor running andSfor suspended state.
- To list all the processes running in the operating system, including the system processes, enter the following command:
$ ps -ef
- The process names in
[]are kernel threads. If you are interested in more options for thepscommand, you can use the following command:
$ man ps- To find a particular process, you can...