我尝试过top -b可以全部打印,而top -b -n 50也可以全部打印。我需要打印50行。
top -b
top -b -n 50
尝试将输出传递给head命令。
top -b -n 1 | head -57
[57,因为top的输出开头有7条额外的行。
57
top