ps

From RaySoft

ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top instead.[1]

Documentation

Further information

Syntax

ps [PARAMETER ...]

Parameters

-e
Select all processes. Identical to -A.
-f
Does full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be printed.
--forest
ASCII art process tree.
-H
Show process hierarchy (forest).

Examples

Start a program (dropbox) if it is not already running
if [[ $(ps -eo 'args' | grep 'dropbox' | grep -cv 'grep') -eq 0 ]]; then
  ${HOME}/.dropbox-dist/dropbox &
fi

References

  1. man 1 'ps'