TTY tells you the terminal in which the process runs The command tty will

Tty tells you the terminal in which the process runs

This preview shows page 6 - 9 out of 15 pages.

TTY tells you the terminal in which the process runs. The command tty will display the name of your terminal. TIME tells you the CPU time used by the process. CMD shows the command that was used to invoke the process. ps has many options. One often used is -f . With this option more information will be displayed: hong:~ $ps -f UID PID PPID C STIME TTY TIME CMD xie 31587 31586 0 21:43 pts/0 00:00:00 -bash xie 31604 31587 0 21:52 pts/0 00:00:00 ps -f hong:~ $ in the above example, UID shows the user that created the process. PPID is the parent PID. STIME is the starting time of the process. Another useful option is -l : hong:~ $ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 000 S 1002 31587 31586 0 72 0 - 502 wait4 pts/0 00:00:00 bash 000 R 1002 31611 31587 0 76 0 - 795 - pts/0 00:00:00 ps hong:~ $
Image of page 6
in this example, S tells you the process state: S for sleep, R for running, T for stopped, Z for zombie or defunct processes. UID shows you the User ID number of the user who created the process. In Unix, each user has a username (such as xie in above example) and a integer uid (such as 1002 for user xie , and 0 for root). PRI tells you the scheduling priority of the process. It is between 0 (high) and 127 (low). NI is 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 -el F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 100 S 0 1 0 0 68 0 - 104 do_sel ? 00:00:12 init 040 S 0 2 1 0 69 0 - 0 contex ? 00:00:00 keventd 040 S 0 3 1 0 78 19 - 0 ksofti ? 00:00:00 ksoftirqd 040 S 0 4 1 0 69 0 - 0 kswapd ? 00:01:22 kswapd 040 S 0 5 1 0 69 0 - 0 bdflus ? 00:00:00 bdflush 040 S 0 6 1 0 69 0 - 0 kupdat ? 00:00:17 kupdated 040 S 0 7 1 0 69 0 - 0 jfsIOW ? 00:00:00 jfsIO 040 S 0 8 1 0 69 0 - 0 jfs_la ? 00:00:00 jfsCommit 040 S 0 9 1 0 69 0 - 0 jfs_sy ? 00:00:00 jfsSync 140 S 1 63 1 0 69 0 - 347 do_pol ? 00:00:00 rpc.portm 040 S 0 69 1 0 69 0 - 445 do_sel ? 00:03:25 syslogd 140 S 0 72 1 0 69 0 - 327 do_sys ? 00:00:00 klogd 140 S 0 74 1 0 68 0 - 443 do_sel ? 00:18:34 inetd 140 S 0 77 1 0 69 0 - 684 do_sel ? 00:01:05 sshd 040 S 0 86 1 0 69 0 - 332 do_pol ? 00:00:00 rpc.rquot 140 S 0 88 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 90 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 89 1 0 69 0 - 0 svc_re ? 00:00:00 lockd 040 S 0 91 89 0 69 0 - 0 rpciod ? 00:00:00 rpciod 040 S 0 92 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd
Image of page 7
040 S 0 93 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 94 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 95 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 96 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 97 1 0 69 0 - 0 svc_re ? 00:00:00 nfsd 040 S 0 100 1 0 69 0 - 341 do_pol ? 00:00:00 rpc.mount 140 S 0 103 1 0 69 0 - 347 do_sel ? 00:00:00 rpc.statd 140 S 0 105 1 0 69 0 - 452 do_sel ? 00:00:00 lpd 040 S 0 107 1 0 68 0 - 339 nanosl ? 00:00:00 crond 040 S 2 110 1 0 69 0 - 339 nanosl ? 00:00:00 atd 140 S 0 121 1 0 68 0 - 821 do_sel ? 00:00:00 httpd 100 S 0 127 1 0 79 19 - 859 nanosl ? 00:00:00 dnetc 000 S 0 131 1 0 69 0 - 449 wait4 ? 00:00:00 RunCache 140 S 99 143 121 0 69 0 - 859 wait_f ? 00:00:02 httpd 140 S 99 144 121 0 69 0 - 852 wait_f ?
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 15 pages?

  • One '14
  • Array, File system permissions, Dr Hong Xie

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture