The ps (process status) command produces a list of processes on the system that can be used to determine how long a process has been running, how much CPU resource processes are using, and if processes are being penalized by the system. It will also show how much memory processes are using, how much I/O a process is performing, the priority and nice values for the process, and who created the process.
The ps command has a variety of options. Helpful ps commands shows some helpful ps commands.
Helpful ps commands
|To display the top 10 CPU consuming processes.||
|To display the top 10 memory consuming processes.||
Note: 10 is the default value for the head command.
|To display the top 10 memory consuming processes by sz (virtual size in kilobytes of the data section of the process).||
|To display the processes in order of being penalized by the Virtual Memory Manager (sorted by the C column).||
|To display the processes in priority order.||ps -eak1 | sort -n +6 | head|
|To display the processes in nice order||ps -eak1 | sort -n +7|
|To display the processes in CPU time/utilization order.||
|To display the processes in order of real memory usage. The RSS value is the size of the working segment and the code segment in 1 kilobyte blocks.||
|To display the processes in I/O order.