Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 711 #737
i
i
i
i
i
i
i
i
28
System Monitoring Utilities
If you press
F while top is running, a menu opens with which to make
extensive changes to the format of the output.
The parameter -U hUIDi monitors only the processes associated with a
particular user. Here, hUIDi is the user ID of the user. The following variant
is useful:
$ top -U $(id -u <username>)
28.5 Process List: ps
The command ps produces a list of processes. If the parameter r is added,
only those processes really running are shown:
$ ps r
PID TTY STAT TIME COMMAND
22163 pts/7 R 0:01 -zsh
3396 pts/3 R 0:03 emacs new-makedoc.txt
20027 pts/7 R 0:25 emacs xml/common/utilities.xml
20974 pts/7 R 0:01 emacs jj.xml
27454 pts/7 R 0:00 ps r
This parameter must be written without a minus sign. The various param-
eters are written sometimes with and sometimes without the minus sign.
The man page could easily frighten off potential users, but fortunately, the
ps --help command produces a brief page of help.
To check how many emacs processes are running, use:
$ ps x | grep emacs
1288 ? S 0:07 emacs
3396 pts/3 S 0:04 emacs new-makedoc.txt
3475 ? S 0:03 emacs .Xresources
20027 pts/7 S 0:40 emacs xml/common/utilities.xml
20974 pts/7 S 0:02 emacs jj.xml
$ pidof emacs
20974 20027 3475 3396 1288
The parameter -p selects processes via the process ID:
711
SUSE LINUX Enterprise Server