Monitoring processes using ps
We have used the command ps
in the introduction. Let's learn more about it:
- To list the process 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
PID
column and the parent process ID in thePPID
column in the preceding output. - To list processes with the parent process ID along with the process state, enter the following command:
Get Learning Linux Shell Scripting now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.