📄 ch38_05.htm
字号:
CLASS="entry"ROWSPAN="1"COLSPAN="1">Z: <SPANCLASS="link">Zombie process (<ACLASS="linkend"HREF="ch38_16.htm"TITLE="Why You Can't Kill a Zombie ">38.16</A>)</SPAN>.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">D (BSD): Disk wait.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">P (BSD): Page wait.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">X (System V): Growing: waiting for memory.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">K (AIX): Available kernel process.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">W (BSD): Swapped out.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">N (BSD): <SPANCLASS="link">Niced (<ACLASS="linkend"HREF="ch39_09.htm"TITLE='Know When to Be "nice" to OTher Users...and WhenNot to'>39.9</A>, <ACLASS="linkend"HREF="ch39_11.htm"TITLE="Changing a Job's Priority Under BSD UNIX ">39.11</A>)</SPAN>:execution priority lowered.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">> (BSD): Execution priority<SPANCLASS="link">artificially raised (<ACLASS="linkend"HREF="ch39_11.htm"TITLE="Changing a Job's Priority Under BSD UNIX ">39.11</A>)</SPAN>.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">TIME</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Total CPU time used.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">COMMAND</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Command line being executed (may be truncated).</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">STIME (System V)</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Time or date process started.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">C (System V),</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Short term CPU-use factor; used by scheduler for</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"> CP (BSD)</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">computing execution priority (PRI below).</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">F</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Flags associated with process (see <EMCLASS="emphasis">ps</EM> manual page).</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">PPID</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Parent's PID.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">PRI</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Actual execution priority (recomputed dynamically).</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">NI</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Process <SPANCLASS="link">nice number (<ACLASS="linkend"HREF="ch39_09.htm"TITLE='Know When to Be "nice" to OTher Users...and WhenNot to'>39.9</A>)</SPAN>.</TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">WCHAN</TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1">Event process is waiting for.</TD></TR></TBODY></TABLE><BLOCKQUOTECLASS="footnote"><PCLASS="para">[3] Some vendors add other fields, such as the processor number formultiprocessors and additional or different process states (as in theAIX K field). These codes may differ from vendor to vendor: forexample, the 0 code under Stardent UNIX means a process that isactually running (and R means runable) while 0 under AIX means anonexistent process.</P></BLOCKQUOTE><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-42690"></A>A vaguely similar listing is produced by the System V <EMCLASS="emphasis">ps -ef</EM> command:<BLOCKQUOTECLASS="screen"><PRECLASS="screen">$ <CODECLASS="userinput"><B>ps -ef</B></CODE> UID PID PPID C STIME TTY TIME CMD root 0 0 0 09:36:35 ? 0:00 sched root 1 0 0 09:36:35 ? 0:02 /etc/init ... gull 7997 1 10 09:49:32 ttyp3 0:04 cshmartin 12923 11324 9 10:19:49 ttyp5 56:12 f77 -o foo foo.F chavez 16725 16652 15 17:02:43 ttyp6 10:04 g94 HgO.dat ng 17026 17012 14 17:23:12 console 0:19 vi benzene.txt</PRE></BLOCKQUOTE></P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-42697"></A>The columns hold the username, process ID, parent's PID (thePID of the process that created it), the current schedulervalue, the time the process started, its associated terminal, itsaccumulated CPU time, and the command it is running. Note thatthe ordering is by PID, not resource usage.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-42700"></A>AIX's version of the <EMCLASS="emphasis">ps</EM> command supports both BSDand System V options. The BSD options are not preceded by ahyphen (which is a legal syntax variation), and the System V optionsare. Thus, under AIX, <CODECLASS="literal">ps -au</CODE> is not the same as<CODECLASS="literal">ps au</CODE>. The command is the System V version, however, even ifits output is displayed with the BSD column headings. Thus,<EMCLASS="emphasis">ps aux</EM> output is displayed in <CODECLASS="literal">PID</CODE> rather than<CODECLASS="literal">%CPU</CODE> order.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-42710"></A><ACLASS="indexterm"NAME="AUTOID-42713"></A><EMCLASS="emphasis">ps</EM> is also useful in pipes; a common use is:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>ps -aux | grep chavez</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">to see what user <EMCLASS="emphasis">chavez</EM> has currently running. [Under System V,use <CODECLASS="literal">ps -u chavez</CODE>. <EMCLASS="emphasis">-JP</EM>]</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">AF</SPAN> <SPANCLASS="bibliomisc">from O'Reilly & Associates' <CITECLASS="citetitle">Essential System Administration</CITE>, Chapter 7</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch38_04.htm"TITLE="38.4 Subshells "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 38.4 Subshells "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch38_06.htm"TITLE="38.6 The Controlling Terminal "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 38.6 The Controlling Terminal "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">38.4 Subshells </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">38.6 The Controlling Terminal </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed & awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -