top -b -n 1 -d 3 >> /tmp/top_info.txt
top -d 0.5 -b | grep hello |tee -a > top.txt
解析:
-b :batch模式,可以重定向到文件中
-n 1:一共取1次top数据。后边加数字,表示次数
-d 3:每次top时间间隔是3秒钟
vmstat > file.txt
top -b -n 1 -d 1 >> /tmp/top_info.txt
nohup top -b -n 10 -d 1 >> top1.txt &
nohup top -b -d 1 >> top1.txt &