逆引きUNIXコマンド/topコマンドの出力をファイルに保存したい
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* topコマンドの出力をファイルに出力する方法 [#baaac57b]
topコマンドの出力をファイルに出力する方法を以下に記します。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* 関連記事 [#v1222b48]
-[[htopでターミナルにグラフィカルなプロセス情報を表示する...
* -bオプションを使用してtopコマンドを実行する [#f0840a8b]
topコマンドの出力をそのままファイルに出力するとエスケープ...
情報のみを出力するには''-b''オプションを利用します。
以下の例のように使用するとtopの出力をファイルに保存するこ...
-(例)10秒毎に20回情報を取得しtop_result.logに出力結果を保...
top -b -d 10 -n 20 > top_result.log
尚、''-b''オプションはバッチモードを示します。
''-S''による累積時間の取得もできるようです。~
man topでバッチモード以外のオプションを調べてみることをお...
実際に-bオプションを利用して出力された結果は以下のように...
$ top -b -d 10 -n 20 > top_result.log
$ cat top_result.log
top - 11:43:41 up 2:05, 5 users, load average: 0.01, ...
Tasks: 206 total, 1 running, 203 sleeping, 0 stopped...
Cpu(s): 1.4%us, 0.4%sy, 0.0%ni, 96.6%id, 1.5%wa, 0....
Mem: 3979276k total, 2540772k used, 1438504k free, ...
Swap: 2031608k total, 0k used, 2031608k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
1 root 15 0 10364 692 580 S 0.0 0.0 0:0...
2 root RT -5 0 0 0 S 0.0 0.0 0:0...
3 root 34 19 0 0 0 S 0.0 0.0 0:0...
4 root RT -5 0 0 0 S 0.0 0.0 0:0...
5 root RT -5 0 0 0 S 0.0 0.0 0:0...
6 root 34 19 0 0 0 S 0.0 0.0 0:0...
7 root RT -5 0 0 0 S 0.0 0.0 0:0...
8 root RT -5 0 0 0 S 0.0 0.0 0:0...
9 root 34 19 0 0 0 S 0.0 0.0 0:0...
10 root RT -5 0 0 0 S 0.0 0.0 0:0...
11 root RT -5 0 0 0 S 0.0 0.0 0:0...
12 root 34 19 0 0 0 S 0.0 0.0 0:0...
13 root RT -5 0 0 0 S 0.0 0.0 0:0...
14 root 10 -5 0 0 0 S 0.0 0.0 0:0...
15 root 10 -5 0 0 0 S 0.0 0.0 0:0...
16 root 10 -5 0 0 0 S 0.0 0.0 0:0...
17 root 10 -5 0 0 0 S 0.0 0.0 0:0...
18 root 10 -5 0 0 0 S 0.0 0.0 0:0...
<snip>
以上、topコマンドの出力をファイルに保存する方法でした。
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
終了行:
#navi(../)
* topコマンドの出力をファイルに出力する方法 [#baaac57b]
topコマンドの出力をファイルに出力する方法を以下に記します。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* 関連記事 [#v1222b48]
-[[htopでターミナルにグラフィカルなプロセス情報を表示する...
* -bオプションを使用してtopコマンドを実行する [#f0840a8b]
topコマンドの出力をそのままファイルに出力するとエスケープ...
情報のみを出力するには''-b''オプションを利用します。
以下の例のように使用するとtopの出力をファイルに保存するこ...
-(例)10秒毎に20回情報を取得しtop_result.logに出力結果を保...
top -b -d 10 -n 20 > top_result.log
尚、''-b''オプションはバッチモードを示します。
''-S''による累積時間の取得もできるようです。~
man topでバッチモード以外のオプションを調べてみることをお...
実際に-bオプションを利用して出力された結果は以下のように...
$ top -b -d 10 -n 20 > top_result.log
$ cat top_result.log
top - 11:43:41 up 2:05, 5 users, load average: 0.01, ...
Tasks: 206 total, 1 running, 203 sleeping, 0 stopped...
Cpu(s): 1.4%us, 0.4%sy, 0.0%ni, 96.6%id, 1.5%wa, 0....
Mem: 3979276k total, 2540772k used, 1438504k free, ...
Swap: 2031608k total, 0k used, 2031608k free, ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TI...
1 root 15 0 10364 692 580 S 0.0 0.0 0:0...
2 root RT -5 0 0 0 S 0.0 0.0 0:0...
3 root 34 19 0 0 0 S 0.0 0.0 0:0...
4 root RT -5 0 0 0 S 0.0 0.0 0:0...
5 root RT -5 0 0 0 S 0.0 0.0 0:0...
6 root 34 19 0 0 0 S 0.0 0.0 0:0...
7 root RT -5 0 0 0 S 0.0 0.0 0:0...
8 root RT -5 0 0 0 S 0.0 0.0 0:0...
9 root 34 19 0 0 0 S 0.0 0.0 0:0...
10 root RT -5 0 0 0 S 0.0 0.0 0:0...
11 root RT -5 0 0 0 S 0.0 0.0 0:0...
12 root 34 19 0 0 0 S 0.0 0.0 0:0...
13 root RT -5 0 0 0 S 0.0 0.0 0:0...
14 root 10 -5 0 0 0 S 0.0 0.0 0:0...
15 root 10 -5 0 0 0 S 0.0 0.0 0:0...
16 root 10 -5 0 0 0 S 0.0 0.0 0:0...
17 root 10 -5 0 0 0 S 0.0 0.0 0:0...
18 root 10 -5 0 0 0 S 0.0 0.0 0:0...
<snip>
以上、topコマンドの出力をファイルに保存する方法でした。
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
ページ名: