⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ps.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>ps</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_1802">&nbsp;</a>NAME</h4><blockquote>ps - report process status</blockquote><h4><a name = "tag_001_014_1803">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>ps <b>[</b>-aA<b>][</b>-defl<b>][</b>-G <i>grouplist</i><b>][</b>-o <i>format</i><b>]</b>...<b>[</b>-p <i>proclist</i><b>][</b>-t <i>termlist</i><b>][</b>-U <i>userlist</i><b>][</b>-g <i>grouplist</i><b>][</b>-n <i>namelist</i><b>][</b>-u <i>userlist</i><b>]</b></code></pre></blockquote><h4><a name = "tag_001_014_1804">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>ps</i>utility writes information about processes, subject to havingthe appropriate privileges to obtain information about those processes.<p>By default,<i>ps</i>selects all processes with the same effective user IDas the current user and the same controlling terminal as the invoker.</blockquote><h4><a name = "tag_001_014_1805">&nbsp;</a>OPTIONS</h4><blockquote>The<i>ps</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .<p>The following options are supported:<dl compact><dt><b>-a</b><dd>Write information for all processes associated with terminals.Implementations may omit session leaders from this list.<dt><b>-A</b><dd>Write information for all processes.<dt><b>-d</b><dd>Write information for all processes, except session leaders.<dt><b>-e</b><dd>Write information for all processes(equivalent to<b>-A</b>).<dt><b>-f</b><dd>Generate a<i>full</i>listing.(See the STDOUT section for the contents of a full listing.)<dt><b>-g&nbsp;</b><i>grouplist</i><dd>Write information for processes whose session leaders are given in<i>grouplist</i>.The<i>grouplist</i>must be a single argument in the form ofablank-or comma-separated list.<dt><b>-G&nbsp;</b><i>grouplist</i><dd>Write information for processes whose real group ID numbers are given in<i>grouplist</i>.The<i>grouplist</i>must be a single argument in the form ofablank-or comma-separated list.<dt><b>-l</b><dd>Generate a<i>long</i>listing.(See the STDOUT section for the contents of a long listing.)<dt><b>-n&nbsp;</b><i>namelist</i><dd>Specify the name of an alternative system<i>namelist</i>file in place of the default.The name of the default file and the format of a<i>namelist</i>file are unspecified.<dt><b>-o&nbsp;</b><i>format</i><dd>Write information according to the format specification given in<i>format</i>.This is fully described in the STDOUT section.Multiple<b>-o</b>options can be specified; the format specification will be interpretedas thespace-character-separatedconcatenation of all the<i>format</i>option-arguments.<dt><b>-p&nbsp;</b><i>proclist</i><dd>Write information for processes whose process ID numbers are given in<i>proclist</i>.The<i>proclist</i>must be a single argument in the form ofablank-or comma-separated list.<dt><b>-t&nbsp;</b><i>termlist</i><dd>Write information for processes associated with terminals given in<i>termlist</i>.The<i>termlist</i>must be a single argument in the form ofablank-or comma-separated list.Terminal identifiers must be givenin one of two forms:the device's filename (for example,<b>tty04</b>)or, if the device's filename starts with<b>tty</b>,just theidentifier following the characters<b>tty</b>(for example,<b>04</b>).<dt><b>-u&nbsp;</b><i>userlist</i><dd>Write information for processes whose user ID numbers orlogin names are given in<i>userlist</i>.The<i>userlist</i>must be a single argument in the form ofablank-or comma-separated list.In the listing, the numerical user IDwill be written unless the<b>-f</b>option is used, in which casethe login name will be written.<dt><b>-U&nbsp;</b><i>userlist</i><dd>Write information for processes whose real user ID numbers orlogin names are given in<i>userlist</i>.The<i>userlist</i>must be a single argument in the form ofablank-or comma-separated list.</dl><p>With the exception of<b>-o</b>&nbsp;<i>format</i>,all of the options shown are used to select processes.If any are specified, the default list will be ignored and<i>ps</i>will selectthe processes represented by the inclusive ORof all the selection-criteria options.</blockquote><h4><a name = "tag_001_014_1806">&nbsp;</a>OPERANDS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1807">&nbsp;</a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_1808">&nbsp;</a>INPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1809">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>ps</i>:<dl compact><dt><i>COLUMNS</i><dd>Override the system-selected horizontal screen size,used to determine the number of text columns to display.Seethe <b>XBD</b> specification, <a href="../xbd/envvar.html"><b>Environment Variables</b>&nbsp;</a> for valid values and results when it is unset or null.<dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard errorand informative messages written to standard output.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i><dt><i>LC_TIME</i><dd>Determine theformat and contents of the date and time strings displayed.</dl></blockquote><h4><a name = "tag_001_014_1810">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1811">&nbsp;</a>STDOUT</h4><blockquote>When the<b>-o</b>option is not specified, the standard output format isas follows.The column headings anddescriptions of the columns in a<i>ps</i>listing are given below.The precise meanings of these fields are implementation-dependent.The letters<b>f</b>and<b>l</b>(below) indicate the option (<b> full</b>or<b>long</b>)that causes the corresponding heading to appear;<b>all</b>means that the heading always appears.Note that these two options determineonly what information is provided for a process; they donot determine which processes will be listed.<pre><table  align=center><tr valign=top><th align=left>F<th align=left>(l)<th align=center> Flags (octal and additive) associated with the process. <tr valign=top><td align=left>S<td align=left>(l)<td align=center>The state of the process.<tr valign=top><td align=left>UID<td align=left>(f,l)<td align=center> The user ID number of the process owner; the login name is printed under the <b>-f</b> option. <tr valign=top><td align=left>PID<td align=left>(all)<td align=center> The process ID of the process; it is possible to kill a process if this datum is known. <tr valign=top><td align=left>PPID<td align=left>(f,l)<td align=center>The process ID of the parent process.<tr valign=top><td align=left>C<td align=left>(f,l)<td align=center>Processor utilisation for scheduling.<tr valign=top><td align=left>PRI<td align=left>(l)<td align=center> The priority of the process; higher numbers mean lower priority. <tr valign=top><td align=left>NI<td align=left>(l)<td align=center> Nice value; used in priority computation. <tr valign=top><td align=left>ADDR<td align=left>(l)<td align=center>The address of the process.<tr valign=top><td align=left>SZ<td align=left>(l)<td align=center> The size in blocks of the core image of the process. <tr valign=top><td align=left>WCHAN<td align=left>(l)<td align=center> The event for which the process is waiting or sleeping; if blank, the process is running. <tr valign=top><td align=left>STIME<td align=left>(f)<td align=center>Starting time of the process.<tr valign=top><td align=left>TTY<td align=left>(all)<td align=center>The controlling terminal for the process.<tr valign=top><td align=left>TIME<td align=left>(all)<td align=center> The cumulative execution time for the process. <tr valign=top><td align=left>CMD<td align=left>(all)<td align=center> The command name; the full command name and its arguments are written under the <b>-f</b> option. </table></pre><p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -