12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4Getting Information about Running Processes—ps,top, and pgrepTo see a list of currently running processes, you can use the ps(1) command. Theps utility shows a list containing information about the running processes, theirPIDs, current process status, the process owner, and other information based on thecommand line arguments you specify.# psPID TT STAT TIME COMMAND893 v0 Is+ 0:00.00 /usr/libexec/getty Pc ttyv0894 v1 Is+ 0:00.00 /usr/libexec/getty Pc ttyv1895 v2 Is+ 0:00.00 /usr/libexec/getty Pc ttyv2896 v3 Is+ 0:00.00 /usr/libexec/getty Pc ttyv3908 p0 I 0:00.01 su -909 p0 S 0:00.14 -su (csh)5638 p0 R+ 0:00.00 psThe above output shows a list of currently running processes, which are owned bythe current user. To see a list of all the processes running on the system, you can use-a flag. The popular combination of argument for ps is -auxww. The -u argumentshows the owner, the name for each process, -x shows processes that are notattached to any terminals (mostly daemons), and -ww shows the outputin wide format, including the complete command line with arguments of therunning process.Using the ps command, you can see only the process list and its status, the momentyou invoke the ps command. Instead, top(1) command shows an interactive andlive list of running processes, sorted by their PID. The top can be used to identifythe active processes and see how much of the system resources they use. The top(1)also shows the current memory allocation and processor(s) status for the system andeach process.[ 65 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!