Answers:
该-n开关是您搜索的内容:
user@host:~$ top -n 1
参见手册
-n : Number of iterations limit as: -n number
Specifies the maximum number of iterations, or frames, top should produce before ending.
如果要停止top命令,请按q。
注意:如果您倾向于top在脚本中使用,我需要说top的不是针对脚本,ps而是使用。
top在脚本中使用,因为我认为ps无法读取平均CPU负载。我错了吗?
man command)。