Scripting獲取非互動式 shell 的
獲取非互動式 shell 的 top
輸出
我想為網路應用程序實現頂級功能。是否可以
top
在非互動式 shell 中獲取命令的輸出?
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.