linux:commands:process

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
linux:commands:process [2019/01/21 23:26] – [プロセス表示[ps]] ともやんlinux:commands:process [2024/03/31 05:27] – [参考文献] ともやん
行 1: 行 1:
 ====== プロセス関連 ====== ====== プロセス関連 ======
 +
 ===== プロセス表示[ps] ===== ===== プロセス表示[ps] =====
 現在実行されているプロセスのスナップショットを表示する。 現在実行されているプロセスのスナップショットを表示する。
-<code+<WRAP color_term
-$ ps +<WRAP color_command><html><pre> 
-</code+<font color="#FF8700"><b>$</b></font> <font color="#26A269">ps</font> 
-<code+</pre></html></WRAP
-   PID TTY          TIME CMD +<WRAP color_result><html><pre
-  2084 pts/   00:00:12 bash +    PID TTY          TIME CMD 
-  3879 pts/   00:00:00 ps + 851455 pts/   00:00:00 zsh 
-</code> + 854417 pts/   00:00:00 ps 
-aux オプションでユーザー、CPU使用率、メモリー使用率などを表示する。 +</pre></html></WRAP> 
-<code+</WRAP> 
-$ ps aux + 
-</code+<html><code>ps fu</code></html> オプションで、ユーザー、階層表示する。 
-<code>+<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<font color="#FF8700"><b>$</b></font> <font color="#26A269">ps</font> fu 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND 
 +tomoyan   851455  0.0  0.4   8888  4560 pts/0    Ss   04:42   0:00 -zsh 
 +tomoyan   854512  0.0  0.4   8244  4608 pts/0    R+   05:05   0:00  \_ ps fu 
 +tomoyan    15144  0.0  0.1  10096  1868 pts/1    Ss    3月17   0:02 -zsh 
 +tomoyan   852684  4.9  3.0 867620 29896 pts/1    Sl+  04:48   0:52  \_ /home/tomoyan/.local/pipx/venvs/jupyter 
 +tomoyan   853162  0.0  0.5   8960  5448 pts/2    Ss+  04:49   0:00      \_ /usr/bin/zsh 
 +tomoyan   853311  0.0  0.0      0     0 pts/1    Z+   04:49   0:00      \_ [node] &lt;defunct&gt; 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +<html><code>ps aux</code></html> オプションでユーザー、CPU使用率、メモリー使用率などを表示する。 
 +<WRAP color_term
 +<WRAP color_command><html><pre><font color="#FF8700"><b>$</b></font> <font color="#26A269">ps</font> aux 
 +</pre></html></WRAP
 +<WRAP color_result_hlong><html><pre>
 USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 root          1  0.1  0.2 105560 12216 ?        Ss   17:52   0:14 /usr/lib/systemd/systemd --switched-root root          1  0.1  0.2 105560 12216 ?        Ss   17:52   0:14 /usr/lib/systemd/systemd --switched-root
-root        607  0.0  0.0  32760  1840 ?        S<sl 17:52   0:00 /sbin/auditd+root        607  0.0  0.0  32760  1840 ?        S&lt;sl 17:52   0:00 /sbin/auditd
 root        634  0.0  0.2 258548 16444 ?        Ssl  17:52   0:05 /usr/sbin/rsyslogd -n root        634  0.0  0.2 258548 16444 ?        Ssl  17:52   0:05 /usr/sbin/rsyslogd -n
 root        636  0.0  0.0  17112  5932 ?        Ss   17:52   0:02 /sbin/rngd -f root        636  0.0  0.0  17112  5932 ?        Ss   17:52   0:02 /sbin/rngd -f
行 63: 行 83:
 〜省略〜 〜省略〜
 tomoyan    4234  0.0  0.0 228192  3972 pts/4    R+   20:22   0:00 ps aux tomoyan    4234  0.0  0.0 228192  3972 pts/4    R+   20:22   0:00 ps aux
 +</pre></html></WRAP>
 +</WRAP>
 +
 +===== プロセス優先度の変更[renice] =====
 +<code>
 +$ sudo renice -3 1982
 +1982 (process ID) 従来の優先順位は 0 で, 新しい優先順位は -3 です
 </code> </code>
  
行 108: 行 135:
 | Shift + w | 設定の保存 | | Shift + w | 設定の保存 |
 | q | top コマンドの終了 | | q | top コマンドの終了 |
 +
 +===== 参考文献 =====
 +[[https://unix.stackexchange.com/questions/372388/how-can-i-make-ps-command-show-memory-in-mb-instead-of-kb|size - How can I make 'ps' command show memory in MB instead of KB? - Unix & Linux Stack Exchange]]\\
 +[[https://atmarkit.itmedia.co.jp/ait/articles/1603/28/news022.html|【 ps 】コマンド――実行中のプロセスを一覧表示する:Linux基本コマンドTips(6) - @IT]]\\
 +
  • linux/commands/process.txt
  • 最終更新: 2024/03/31 05:49
  • by ともやん