Skip to main content

ps and top command examples.


# See all processes running on the system
#  "head -20" limits the output to the first 20 lines
ps -ax | head -20

# process overview summary
top -l 1 | head -7

# To display processes sorted by CPU usage (rather than process ID)
top -o cpu

# Update display every 5-seconds rather than the default of every second,
# and sort the results by CPU usage.
top -s 5 -o cpu

# see the processes that a certain user is running
ps -U username

# what processes are being run as root
ps -ax -U root | head

# hit "q" to quit display