←  linux commands

Views:

ps command

The ps command is used to output running processes' status and information.

Syntax: ps [options]

Example: I have created a simple http server using python. So that we can list and see its process information.

ps
ps-output

Options:

-a Display information about other users' processes as well as your own. This will skip any processes which do not have a controlling terminal.

Example:

ps -a
ps-a-output
-C List process with command name.

Example:

ps -C python3
ps-command-output
-o For custom output format.

Example: In following command, we are outputing only the pid and command for process with python3 as executable command name.

ps -C python3 -o pid,cmd
ps-o-output

Example: Outputing process memory consumption.

ps -o pid,%mem
ps-mem-output