LoginSignup
6
6

More than 5 years have passed since last update.

[Linux][shell][top] topコマンドの実行コマンド欄を省略せずに全て表示する

Last updated at Posted at 2016-02-16

標題の件。-c オプションを使用する。

-b でバッチモードで実行
-n 1 で1回のみ実行

# 通常の場合
$ top -b -n 1
top - 00:18:14 up 31 min,  2 users,  load average: 0.10, 0.06, 0.12
Tasks: 184 total,   2 running, 182 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.2 us,  1.4 sy,  0.2 ni, 96.1 id,  1.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   4048016 total,  1701140 used,  2346876 free,   260588 buffers
KiB Swap:  2095100 total,        0 used,  2095100 free.   761484 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
28249 koaralo+  20   0   29960   1536   1092 R   6.2  0.0   0:00.02 top
    1 root      20   0   33896   3216   1488 S   0.0  0.1   0:01.34 init
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.39 ksoftirqd/0
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.06 kworker/u8:0
    7 root      20   0       0      0      0 S   0.0  0.0   0:03.92 rcu_sched
    8 root      20   0       0      0      0 S   0.0  0.0   0:03.22 rcuos/0
<後略>

# -c オプションを着けて実行コマンド欄をフルで表示する
$ top -c -b -n 1
top - 00:26:27 up 40 min,  2 users,  load average: 0.01, 0.10, 0.15
Tasks: 187 total,   1 running, 186 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.2 us,  1.4 sy,  0.2 ni, 96.4 id,  0.8 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   4048016 total,  1705068 used,  2342948 free,   261048 buffers
KiB Swap:  2095100 total,        0 used,  2095100 free.   767520 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 1358 root      20   0  442100 104932  21176 S  12.1  2.6   0:23.11 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
  865 mongodb   20   0  382052  44228   6872 S   6.1  1.1   0:57.36 /usr/bin/mongod --config /etc/mongodb.conf
 2093 koaralo+  20   0 1351844  74600  37068 S   6.1  1.8   0:29.32 compiz
 2350 koaralo+  20   0   32908   2520   1392 S   6.1  0.1   0:23.72 tmux
    1 root      20   0   33896   3216   1488 S   0.0  0.1   0:01.34 /sbin/init
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 [kthreadd]
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.40 [ksoftirqd/0]
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.00 [kworker/0:0]
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 [kworker/0:0H]
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.06 [kworker/u8:0]
    7 root      20   0       0      0      0 S   0.0  0.0   0:04.69 [rcu_sched]
    8 root      20   0       0      0      0 S   0.0  0.0   0:03.82 [rcuos/0]
<後略>
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6