Module 109 ps

Previous Table of Contents Next


Module 109
ps

DESCRIPTION

The external ps command is used to report process status. A process is a single task the computer is executing. When you execute a program such as cat , your shell spawns a new process (task). On UNIX there are multiple tasks waiting for execution. Each task is assigned a process ID (PID). Using the ps command you can display information about these various processes.

Without options the ps command reports the process ID, the associated tty, the cumulative execution time, and the command being executed. Various options to ps cause more detailed information to be retrieved and select certain processes to be reported .

COMMAND FORMAT

Following is the general format of the ps command.

 ps [ -acdefjl ] [ -g grplist ] [ -n name ] [ -p proclist ] \         [ -s sesslist ] [ -t ttylist ] [ -u uidlist ] 

BSD (Berkeley)
ps [ -acegklnsuvwxUn ] [ -ttty ] [ name ] [ core ]
ps [ -acegklnsuvwxUttty n ] [ name ] [ core ]
The n option must be last.

Options

The following list describes the options and their arguments that may be used to control how ps functions.

-a Displays information about all processes except process group leaders and processes not associated with a terminal.
-c Display information about scheduler priorities.
-d Displays information about all processes except group leaders.
-e Displays information about all processes currently in the system s process table. All active processes.
-f Displays a full listing of header information. The columns listed are:
UID PID PPID STIME TTY TIME COMMAND
See the Column Header section that follows for complete definitions of each column header. This option only changes the number of columns displayed. It does not determine which processes to list.
-j Display session IDs and process group IDs.
-l Displays a long listing of header information. The columns listed are:
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME COMMAND
See the Column Header section that follows for complete definitions of each column header. This command only changes the number of columns displayed. It does not determine which processes to list.
-g grplist Display only the processes whose process group leader s IDs are provided in the grplist. The list can be comma separated with no spaces or enclosed in quotes and space separated.
-n name Use the file name as an alternate system executable file in place of the default /unix executable. This is the bootable UNIX kernel file. This file contains the names and addresses of variables used in the system kernel. The ps command needs the information held in these variables. Using a different name allows you to obtain information from a previous version of the operating system that has been saved in a system crash file.
-p proclist Display only the processes whose process IDs are given in the proclist. The list can be comma separated with no spaces or enclosed in quotes and space separated.
-s sesslist Display information on all session leaders listed.
-t ttylist Displays only the processes associated with the terminals given in ttylist. Terminal names are the device s filename; for example, tty05 or co. If the name begins with tty then only the number is required. For example, 14 is interpreted as tty14. The list can be comma separated with no spaces or enclosed in quotes and space separated.
-u uidlist Displays only the processes whose user ID (UID) or login name is given in uidlist. The UID is displayed in the ps listing unless you use the -f option; then the login name is displayed.
If no options are provided ps defaults to a minimal listing, displaying only processes associated with your terminal. The header columns displayed are:
PID TTY TIME COMMAND


Previous Table of Contents Next

Copyright Wordware Publishing, Inc.


Illustrated UNIX System V
Illustrated Unix System V/Bsd
ISBN: 1556221878
EAN: 2147483647
Year: N/A
Pages: 144
Authors: Robert Felps

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net