非対話型シェルの「トップレベル」出力を取得する

非対話型シェルの「トップレベル」出力を取得する

Webアプリケーションに最高の機能を実装したいです。top非対話型シェルからコマンドの出力を取得できますか?

ベストアンサー1

top -b -n 1

からman top

  -b : Batch mode operation
        Starts top in 'Batch mode', which could be useful for 
        sending output from  top  to other programs  or  to  
        a file.  In this mode, top will not accept input and runs
        until the iterations limit you've set with the '-n' 
        command-line option  or  until killed.

おすすめ記事