Wednesday, January 1, 2020

Examples of the ps command within Linux

Below are some examples of the ps command within Linux.

ps -eH --forest | less

This will list all processes (-e select all processes) and (-H hierarchy), as well as --forest includes ASCII lines.


The -f switch is for full-format and will include more columns.

ps -ef | less


The -u switch returns data for a particular user.

ps -u username | less

The -sort switch allows the information to be sorted by columns.

ps -e -o pcpu,args --sort -pcpu| less


Pipe through the head command to see the ten most CPU intensive processes.

ps -e -o pcpu,args --sort -pcpu | head -10


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.