-j | user, pid, ppid, pgid, sess, jobc, state, tt, time and command.
-l | uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time and command.
-u | user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command.
Sort by cpu usage
| -v | pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem and command.
Sort by memory usage
/bin/ps -j
USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND
dgerman 6289 6288 6289 1b00058 1 S p1 0:00.03 -bash
dgerman 731 730 731 1aff9e0 1 S p2 0:00.02 -bash
dgerman 751 731 751 1aff9e0 1 S+ p2 3:01.68 -bash
dgerman 6455 751 751 1aff9e0 1 S+ p2 0:00.00 sleep 1
/bin/ps -l
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
501 6289 6288 0 31 0 27812 844 - S p1 0:00.04 -bash
501 731 730 0 31 0 27812 792 - S p2 0:00.02 -bash
501 751 731 0 31 0 27812 492 - S+ p2 3:01.86 -bash
501 6644 751 0 31 0 27244 340 - S+ p2 0:00.00 sleep 1
/bin/ps -u
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
dgerman 751 0.4 0.1 27812 492 p2 S+ Mon11AM 3:01.95 -bash
dgerman 6743 0.3 0.0 27244 340 p2 S+ 6:01PM 0:00.00 sleep 1
dgerman 6289 0.3 0.1 27812 844 p1 S 5:58PM 0:00.04 -bash
dgerman 731 0.0 0.1 27812 792 p2 S Mon11AM 0:00.02 -bash
/bin/ps -v
PID STAT TIME SL RE PAGEIN VSZ RSS LIM TSIZ %CPU %MEM COMMAND
6289 S 0:00.04 0 512 0 27812 844 - 0 0.3 0.1 -bash
731 S 0:00.02 0 512 0 27812 792 - 0 0.0 0.1 -bash
751 S+ 3:02.09 0 512 0 27812 492 - 0 0.0 0.1 -bash
6882 S+ 0:00.00 0 1104 0 27244 340 - 0 0.0 0.0 sleep 1
-o | Display keywords specific info appended with an equals = sign and a string.
| -O | Add the information associated with the space or comma separated
list of keywords specified, after the process ID, in the default
information display.
| -p | process ID.
| -x | exclude pruocesses with controlling terminals.
| -T | attached to the device assciated with the standard input.
| -t | specified terminal device.
| -U | specified username.
| -w | 132 columns, specified more than once, ps will use as many columns as necessary without regard for your window size.
| %cpu | The cpu utilization of the process; this is a decaying average
over up to a minute of previous (real) time. Since the time base
over which this is computed varies (since processes may be very
young) it is possible for the sum of all %CPU fields to exceed 100%.
| %mem | percentage of real memory used
| flags | The flags associated with the process as in the include file :
P_ADVLOCK | 00001 | Process may hold a POSIX advisory lock
| P_CONTROLT | 00002 | Has a controlling terminal
| P_INMEM | 00004 | Loaded into memory
| P_NOCLDSTOP | 00008 | No SIGCHLD when children stop
| P_PPWAIT | 00010 | Parent is waiting for child to exec/exit
| P_PROFIL | 00020 | Has started profiling
| P_SELECT | 00040 | Selecting; wakeup/waiting danger
| P_SINTR | 00080 | Sleep is interruptible
| P_SUGID | 00100 | Had set id privileges since last exec
| P_SYSTEM | 00200 | System proc: no sigs, stats or swapping
| P_TIMEOUT | 00400 | Timing out during sleep
| P_TRACED | 00800 | Debugged process being traced
| P_WAITED | 01000 | Debugging process has waited for child
| P_WEXIT | 02000 | Working on exiting
| P_EXEC | 04000 | Process called exec
| P_NOSWAP | 08000 | Another flag to prevent swap out
| P_PHYSIO | 10000 | Doing physical I/O
| P_OWEUPC | 20000 | Owe process an addupc() call atn next ast
| P_SWAPPING | 40000 | Process is being swapped
|
| lim | soft limit on memory used, specified via a call to setrlimit(2).
| lstart | exact time the command started, using the ``%c'' format described in strftime(3).
| nice | scheduling increment (see setpriority(2)).
| rss | real memory (resident set) size of the process (in 1024 byte units).
| start | time the command started. If the command started less than
24 hours ago, the start time is displayed using the ``%l:ps.1p''
format described in strftime(3). If the command started less
than 7 days ago, the start time is displayed using the
``%a6.15p'' format.
Otherwise, the start time is displayed using the ``%e%b%y'' format.
| state | state is given by a sequence of letters, for example,
RWNA . The first letter indicates the run state of the process:
I | idle (sleeping for longer than about 20 seconds).
| R | runnable .
| S | sleeping for less than about 20 seconds.
| T | stopped .
| U | uninterruptible wait.
| Z | dead (a ``zombie'').
| Additional characters after these, if any, indicate additional state information:
| + | in the foreground process group of its control terminal.
| < | raised CPU scheduling priority.
| > | specified a soft limit on memory requirements and is currently exceeding that limit; such a process is (necessarily) not swapped.
| A | asked for random page replacement (VA_ANOM, from vadvise(2), for example, lisp(1) in a garbage collect).
| E | trying to exit.
| L | pages locked in core (for example, for raw I/O).
| N | reduced CPU scheduling priority (see setpriority(2)).
| S | asked for FIFO page replacement (VA_SEQL,
from vadvise(2), for example, a large image processing program using virtual memory to sequentially address voluminous data).
| s | a session leader.
| V | suspended during a vfork.
| W | swapped out.
| X | being traced or debugged.
|
| tt | An abbreviation for the pathname of the controlling terminal, if
any. consisting of the three letters following
/dev/tty , or, for the console, con . followed by a
- if the process can no longer reach that controlling terminal (i.e., it has been revoked).
| wchan | The event (an address in the system) on which a process waits.
When printed numerically, the initial part of the address is
trimmed off and the result is printed in hex, for example,
0x80324000 prints as 324000 .
When printing using the command keyword, a process that has exited and
has a parent that has not yet waited for the process (in other words, a
zombie) is listed as ``'', and a process which is blocked while
trying to exit is listed as ``''. Ps makes an educated guess as
to the file name and arguments given when the process was created by
examining memory or the swap area. The method is inherently somewhat
unreliable and in any event a process is entitled to destroy this information, so the names cannot be depended on too much. The ucomm (accounting) keyword can, however, be depended on.
|
| | |