<h3 style="margin: 16px 0px 8px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">ps命令查看进程</h3><p style="margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">ps命令用于报告当前系统的进程状态,我们先用ps命令(<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">ps -ef</code>)找出<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">nginx</code>进程的PID号。</p><div class="developer-code-block" style="margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);"><pre class="prism-token token line-numbers language-javascript" style="box-sizing: border-box; list-style: inherit; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; overflow-wrap: normal; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;"><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">[</span>root@sharktech <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">~</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">]</span># ps <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>ef<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">|</span>grep <span class="token string" style="box-sizing: border-box; list-style: inherit; color: rgb(126, 198, 153);">'nginx'<br/></span>root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10837</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov01 <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">?</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span> <span class="token literal-property property" style="box-sizing: border-box; list-style: inherit; color: rgb(248, 197, 85);">nginx</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span> master process nginx
www <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10838</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10837</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">24</span> Nov01 <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">?</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">2</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">17</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">32</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">59</span> <span class="token literal-property property" style="box-sizing: border-box; list-style: inherit; color: rgb(248, 197, 85);">nginx</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span> worker process
www <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10839</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10837</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov01 <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">?</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">36</span> <span class="token literal-property property" style="box-sizing: border-box; list-style: inherit; color: rgb(248, 197, 85);">nginx</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span> cache manager process
root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10939</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10879</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">15</span> pts<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">00</span> grep <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>color<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">=</span>auto nginx</code></pre></div><p style="margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">我们可以看到nginx master 的进程ID为<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">10837</code>将其记录下来后面需要使用。</p><h3 style="margin: 16px 0px 8px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">查看进程路径</h3><p style="margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">Linux在启动一个进程时,系统会在/proc下创建一个以PID命名的文件夹,在该文件夹下会有我们的进程的信息,其中包括一个名为exe的文件即记录了绝对路径,通过ll或ls –l命令即可查看。上一个步骤我们已经获取nginx进程ID为<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">10837</code>,使用<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">ls</code>命令来查看下有什么东东。</p><div class="developer-code-block" style="margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);"><pre class="prism-token token line-numbers language-javascript" style="box-sizing: border-box; list-style: inherit; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; overflow-wrap: normal; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;"><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">[</span>root@sharktech <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">~</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">]</span># ls <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>l <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>proc<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">10837<br/></span>total <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0<br/></span>dr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>xr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>xr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>x<span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">2</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> attr</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>rw<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> autogroup</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> auxv</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> cgroup</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>w<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> clear_refs</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> cmdline</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>rw<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> comm</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>rw<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> coredump_filter</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> cpuset
lrwxrwxrwx<span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> cwd <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">></span> <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>root</code><code class="language-javascript" style="box-sizing: border-box; list-style: inherit; display: block; margin-left: 0px; margin-right: 10px; background: transparent; border-radius: 0px; padding: 0px; color: inherit; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; word-break: normal; white-space: inherit; word-spacing: normal; overflow-wrap: break-word; tab-size: 4; hyphens: none; position: relative; vertical-align: baseline;"><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>r<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> environ
lrwxrwxrwx<span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">1</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> exe <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">></span> <span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>usr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>local<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>nginx<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>sbin<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">/</span>nginx
dr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>x<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">2</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> fd
dr<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">-</span>x<span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">--</span><span class="token punctuation" style="box-sizing: border-box; list-style: inherit;">.</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">2</span> root root <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">0</span> Nov <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">12</span> <span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span><span class="token operator" style="box-sizing: border-box; list-style: inherit; color: rgb(103, 205, 204);">:</span><span class="token number" style="box-sizing: border-box; list-style: inherit; color: rgb(240, 141, 73);">19</span> fdinfo</code></pre></div><p style="margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);">其中我们可以看到<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">exe -> /usr/local/nginx/sbin/nginx</code>,这里的<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">exe</code>软连接所指向的路径<code style="box-sizing: border-box; list-style: inherit; display: inline-block; margin-left: 10px; margin-right: 10px; background-color: rgb(243, 245, 249); border-radius: 0px; padding: 0px 12px; color: rgb(10, 191, 91); font-family: Consolas, "Liberation Mono", Menlo, Courier, "Microsoft Yahei", monospace; line-height: 20px; word-break: normal; overflow-wrap: break-word;">usr/local/nginx/sbin/nginx</code>即是nginx进程所在路径。该目录下的文件(夹)含义如下:</p><ul class="ul-level-0 list-paddingleft-2" style="list-style-type: none;"><li><p>cwd符号链接的是进程运行目录;</p></li><li><p>exe符号连接就是执行程序的绝对路径;</p></li><li><p>cmdline就是程序运行时输入的命令行命令;</p></li><li><p>environ记录了进程运行时的环境变量;</p></li><li><p>fd目录下是进程打开或使用的文件的符号连接。</p></li></ul><p>来源:https://cloud.tencent.com/developer/article/2071984</p>
相关文章