In today’s article, we will be explaining the “ps” command, which is the command we use to monitor running processes in Linux.
1. When run without parameters, it lists the running processes of the existing session.
1 2 3 4 | # ps PID TTY TIME CMD 10137 pts/5 00:00:00 ps 21871 pts/5 00:00:00 bash |
2. Usage of ps command with parameters;
ps -ef
ps -elf (Provides detailed information about operations.)
3. If we want to get information about a single process.
1 2 3 4 5 6 7 | $ ps -ef | grep mmon oracle 10312 10150 0 13:22 pts/5 00:00:00 grep mmon oracle 15242 1 0 2013 ? 00:07:44 ora_mmon_taptest $ ps -elf | grep mmon 0 S oracle 10332 10150 0 78 0 - 15297 pipe_w 13:22 pts/5 00:00:00 grep mmon 0 S oracle 15242 1 0 75 0 - 1611264 - 2013 ? 00:07:44 ora_mmon_taptest |
4. If we do not want our process search results to appear.
1 2 | $ ps -elf | grep mmon | grep -v grep 0 S oracle 15242 1 0 75 0 - 1611264 - 2013 ? 00:07:44 ora_mmon_taptest |
5. Simplified version of the ps command.
1 2 | $ pgrep -lf mmon 15242 ora_mmon_taptest |