pavement

Ps

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (added flags info)
Line 2: Line 2:
  
 
There were different switches used in different versions of [[ps]] -- historically, [[SysV]] needs the '''-ef''' switches to show all processes and [[BSD]] needed '''-aux'''. [[ps]] is now smarter and will accept either switch and show you what you wanted to see.  It is, however, a good idea to feed [[ps]] the switches with no hyphen in front of them - ie '''ps aux''' - because while FreeBSD understands either syntax, Linux only understands the latter.
 
There were different switches used in different versions of [[ps]] -- historically, [[SysV]] needs the '''-ef''' switches to show all processes and [[BSD]] needed '''-aux'''. [[ps]] is now smarter and will accept either switch and show you what you wanted to see.  It is, however, a good idea to feed [[ps]] the switches with no hyphen in front of them - ie '''ps aux''' - because while FreeBSD understands either syntax, Linux only understands the latter.
 +
 +
==Common flags==
 +
 +
-a all users, not just the user running the [[ps]] command
 +
-u show system info on commands (user, pid, cpu% etc)
 +
-c show the command only, not the path to it
 +
-x show processes that don't have a terminal controlling them
 +
-r sort by CPU use
 +
  
 
[[Category:System Commands]]
 
[[Category:System Commands]]

Revision as of 18:38, 23 December 2004

ps will show your running processes. If run from a regular user shell or an xterm window, it'll only show you your processes. If run as root, it will show all processes.

There were different switches used in different versions of ps -- historically, SysV needs the -ef switches to show all processes and BSD needed -aux. ps is now smarter and will accept either switch and show you what you wanted to see. It is, however, a good idea to feed ps the switches with no hyphen in front of them - ie ps aux - because while FreeBSD understands either syntax, Linux only understands the latter.

Common flags

-a all users, not just the user running the ps command
-u show system info on commands (user, pid, cpu% etc)
-c show the command only, not the path to it
-x show processes that don't have a terminal controlling them
-r sort by CPU use
Personal tools