100%(1)1 out of 1 people found this document helpful
This preview shows page 6 - 9 out of 15 pages.
TTYtells you the terminal in which the process runs. The command ttywill display the name of your terminal. TIMEtells you the CPU time used bythe process. CMDshows the command that was used to invoke the process.pshas many options. One often used is -f. With this option more information will be displayed:hong:~ $ps -fUID PID PPID C STIME TTY TIME CMDxie 31587 31586 0 21:43 pts/0 00:00:00 -bashxie 31604 31587 0 21:52 pts/0 00:00:00 ps -fhong:~ $in the above example, UIDshows the user that created the process. PPIDis the parent PID. STIMEis the starting time of the process.Another useful option is -l:hong:~ $ps -lF S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD000 S 1002 31587 31586 0 72 0 - 502 wait4 pts/0 00:00:00 bash000 R 1002 31611 31587 0 76 0 - 795 - pts/0 00:00:00 pshong:~ $
in this example, Stells you the process state: Sfor sleep, Rfor running, Tfor stopped, Zfor zombie or defunct processes. UIDshows you the User ID number of the user who created the process. In Unix, each user has a username (such as xiein above example) and a integer uid (such as 1002 for user xie, and 0 for root). PRItells you the scheduling priority of the process. It is between 0 (high) and 127 (low). NIis the nice value, which is used to change the priority indirectly. The nice value is between -20 (a greater chance of a higher priority) and 19 (a greater chance of lower priority).To display all processes, use option -e. You can combine different options together:hong:~ $ps -elF S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD100 S 0 1 0 0 68 0 - 104 do_sel ? 00:00:12 init040 S 0 2 1 0 69 0 - 0 contex ? 00:00:00 keventd040 S 0 3 1 0 78 19 - 0 ksofti ? 00:00:00 ksoftirqd040 S 0 4 1 0 69 0 - 0 kswapd ? 00:01:22 kswapd040 S 0 5 1 0 69 0 - 0 bdflus ? 00:00:00 bdflush040 S 0 6 1 0 69 0 - 0 kupdat ? 00:00:17 kupdated040 S 0 7 1 0 69 0 - 0 jfsIOW ? 00:00:00 jfsIO040 S 0 8 1 0 69 0 - 0 jfs_la ? 00:00:00 jfsCommit040 S 0 9 1 0 69 0 - 0 jfs_sy ? 00:00:00 jfsSync140 S 1 63 1 0 69 0 - 347 do_pol ? 00:00:00 rpc.portm040 S 0 69 1 0 69 0 - 445 do_sel ? 00:03:25 syslogd140 S 0 72 1 0 69 0 - 327 do_sys ? 00:00:00 klogd140 S 0 74 1 0 68 0 - 443 do_sel ? 00:18:34 inetd140 S 0 77 1 0 69 0 - 684 do_sel ? 00:01:05 sshd040 S 0 86 1 0 69 0 - 332 do_pol ? 00:00:00 rpc.rquot140 S 0 88 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd040 S 0 90 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd040 S 0 89 1 0 69 0 - 0 svc_re ? 00:00:00 lockd040 S 0 91 89 0 69 0 - 0 rpciod ? 00:00:00 rpciod040 S 0 92 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd