Use “ps” to display process status

If you run “ps“ command without any options, it will only show your processes who have a controlling terminal:

  1. # ps
  2. PID TT STAT TIME COMMAND
  3. 854 v0 Is+ 0:00.00 /usr/libexec/getty Pc ttyv0
  4. 710 v1 Is+ 0:00.00 /usr/libexec/getty Pc ttyv1
  5. 711 v2 Is+ 0:00.00 /usr/libexec/getty Pc ttyv2
  6. 712 v3 Is+ 0:00.00 /usr/libexec/getty Pc ttyv3
  7. 713 v4 Is+ 0:00.00 /usr/libexec/getty Pc ttyv4
  8. 714 v5 Is+ 0:00.00 /usr/libexec/getty Pc ttyv5
  9. 715 v6 Is+ 0:00.00 /usr/libexec/getty Pc ttyv6
  10. 716 v7 Is+ 0:00.00 /usr/libexec/getty Pc ttyv7
  11. 847 0 Ss 0:00.04 -csh (csh)
  12. 883 0 R+ 0:00.00 ps

If you also want to see processes who don’t have a controlling terminal, add “-x“ option:

  1. # ps -ax
  2. PID TT STAT TIME COMMAND
  3. 0 - DLs 0:00.10 [kernel]
  4. 1 - ILs 0:00.05 /sbin/init --
  5. 2 - DL 0:00.05 [cam]
  6. 3 - DL 0:00.00 [mpt_recovery0]
  7. 4 - DL 0:00.00 [sctp_iterator]
  8. 5 - DL 0:00.04 [pagedaemon]
  9. 6 - DL 0:00.00 [vmdaemon]
  10. 7 - DL 0:00.00 [pagezero]
  11. 8 - DL 0:00.08 [bufdaemon]
  12. 9 - DL 0:00.01 [vnlru]
  13. 10 - DL 0:00.00 [audit]
  14. 11 - RL 50:35.75 [idle]
  15. 12 - WL 0:08.20 [intr]
  16. 13 - DL 0:00.02 [geom]
  17. 14 - DL 0:00.91 [rand_harvestq]
  18. 15 - DL 0:00.44 [usb]
  19. 16 - DL 0:00.20 [syncer]
  20. 302 - Is 0:00.01 dhclient: em0 [priv] (dhclient)
  21. 364 - Is 0:00.00 dhclient: em0 (dhclient)
  22. 379 - Is 0:00.00 /sbin/devd
  23. 524 - Ss 0:00.02 /usr/sbin/syslogd -s
  24. 652 - Is 0:00.00 /usr/sbin/sshd
  25. 655 - Ss 0:00.10 sendmail: accepting connections (sendmail)
  26. 658 - Is 0:00.00 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue (sendmail)
  27. 662 - Ss 0:00.01 /usr/sbin/cron -s
  28. 844 - Ss 0:00.06 sshd: root@pts/0 (sshd)
  29. 854 v0 Is+ 0:00.00 /usr/libexec/getty Pc ttyv0
  30. 710 v1 Is+ 0:00.00 /usr/libexec/getty Pc ttyv1
  31. 711 v2 Is+ 0:00.00 /usr/libexec/getty Pc ttyv2
  32. 712 v3 Is+ 0:00.00 /usr/libexec/getty Pc ttyv3
  33. 713 v4 Is+ 0:00.00 /usr/libexec/getty Pc ttyv4
  34. 714 v5 Is+ 0:00.00 /usr/libexec/getty Pc ttyv5
  35. 715 v6 Is+ 0:00.00 /usr/libexec/getty Pc ttyv6
  36. 716 v7 Is+ 0:00.00 /usr/libexec/getty Pc ttyv7
  37. 847 0 Ss 0:00.04 -csh (csh)
  38. 897 0 R+ 0:00.00 ps -ax

This time, there are more results whose TT columns are -.

The most used “ps“ command is “ps auwwx“ which displays all running processes detailed info, and this is similar to “# ps -ef“ on GNU/Linux:

  1. # ps auwwx
  2. USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
  3. root 11 99.2 0.0 0 16 - RL 5:48PM 54:14.29 [idle]
  4. root 0 0.0 0.0 0 160 - DLs 5:48PM 0:00.10 [kernel]
  5. root 1 0.0 0.0 9492 772 - ILs 5:48PM 0:00.05 /sbin/init --
  6. root 2 0.0 0.0 0 32 - DL 5:48PM 0:00.05 [cam]
  7. root 3 0.0 0.0 0 16 - DL 5:48PM 0:00.00 [mpt_recovery0]
  8. root 4 0.0 0.0 0 16 - DL 5:48PM 0:00.00 [sctp_iterator]
  9. root 5 0.0 0.0 0 32 - DL 5:48PM 0:00.05 [pagedaemon]
  10. root 6 0.0 0.0 0 16 - DL 5:48PM 0:00.00 [vmdaemon]
  11. root 7 0.0 0.0 0 16 - DL 5:48PM 0:00.00 [pagezero]
  12. root 8 0.0 0.0 0 32 - DL 5:48PM 0:00.08 [bufdaemon]
  13. root 9 0.0 0.0 0 16 - DL 5:48PM 0:00.01 [vnlru]
  14. root 10 0.0 0.0 0 16 - DL 5:48PM 0:00.00 [audit]
  15. root 12 0.0 0.0 0 208 - WL 5:48PM 0:08.78 [intr]
  16. root 13 0.0 0.0 0 48 - DL 5:48PM 0:00.02 [geom]
  17. root 14 0.0 0.0 0 16 - DL 5:48PM 0:00.98 [rand_harvestq]
  18. root 15 0.0 0.0 0 160 - DL 5:48PM 0:00.47 [usb]
  19. root 16 0.0 0.0 0 16 - DL 5:48PM 0:00.21 [syncer]
  20. root 302 0.0 0.1 14656 2148 - Is 5:48PM 0:00.01 dhclient: em0 [priv] (dhclient)
  21. _dhcp 364 0.0 0.1 14656 2236 - Is 5:48PM 0:00.00 dhclient: em0 (dhclient)
  22. root 379 0.0 0.2 13628 4932 - Ss 5:48PM 0:00.00 /sbin/devd
  23. root 524 0.0 0.1 14520 2092 - Ss 5:48PM 0:00.02 /usr/sbin/syslogd -s
  24. root 652 0.0 0.3 61316 6564 - Is 5:48PM 0:00.00 /usr/sbin/sshd
  25. root 655 0.0 0.3 24156 5380 - Ss 5:48PM 0:00.10 sendmail: accepting connections (sendmail)
  26. smmsp 658 0.0 0.2 24156 5044 - Is 5:48PM 0:00.00 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue (sendmail)
  27. root 662 0.0 0.1 16624 2212 - Is 5:48PM 0:00.01 /usr/sbin/cron -s

References:
ps — process status;
Processes and Daemons;
Show all processes in FreeBSD.