top ======== タスクのスナップショットを表示する -------- {{TOC 3-}} ### top 起動 $ top 以下のような画面になり、数秒ごとに表示が更新されます。 top - 12:08:05 up 11 days, 17:22, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 92 total, 1 running, 91 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 510652k total, 366436k used, 144216k free, 72524k buffers Swap: 524280k total, 14988k used, 509292k free, 216804k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 12 root 20 0 0 0 0 S 0.3 0.0 0:00.22 events/1 1911 bayashi 20 0 2384 1080 832 R 0.3 0.2 0:00.01 top 2778 tiarra 20 0 28908 15m 1836 S 0.3 3.0 12:33.32 tiarra 1 root 20 0 2152 516 492 S 0.0 0.1 0:00.44 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.11 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:00.09 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.12 migration/1 6 root 20 0 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/1 7 root RT 0 0 0 0 S 0.0 0.0 0:00.22 migration/2 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/2 9 root RT 0 0 0 0 S 0.0 0.0 0:00.15 migration/3 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/3 11 root 20 0 0 0 0 S 0.0 0.0 0:00.02 events/0 13 root 20 0 0 0 0 S 0.0 0.0 0:00.01 events/2 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events/3 15 root 20 0 0 0 0 S 0.0 0.0 0:00.02 khelper 19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr 22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenwatch 「q」を押すか、Ctrl+C で終了します。 ### top 起動中のショートカット 以下のショートカットで、タスクの並び順を変更できます。 | ------------ | ----------- | | **ショートカット**| **ソートキー** | | Shift+p | CPU | | Shift+n | PID | | Shift+m | メモリ | | Shift+t | 実行時間 | | Shift+r | ソート順の昇順/降順切り替え | [ソート順切り替えショートカット] Shift+o または Shift+f でソートするカラムを選択して並べ替えることも可能です。 以下のようなコマンドも使用できます。 | ------------ | ----------- | | **コマンド** | **ソートキー** | | 1 | CPUごとの表示 | | c | コマンド列の名前とコマンドラインの切り替え | | s | 更新間隔の変更 | | u | ユーザ絞込み | | q | topコマンドの終了 | [] ### ヘルプ 「h」キーを押すとヘルプを見ることが出来ます。