将top命令的输出,写入到文件中 top -b -n 1 -d 3 >>file.txt top -b -n 1 -d 3 >>file.txt 解析: -b :batch模式,可以重定向到文件中 -n 1:一共取1次top数据。后边加数字,表示次数 -d 3:每次top时间间隔是3秒钟 vmstat >file.txt