One - One Code All

Blog Content

Shell执行命令并把结果写入文件

Linux-Mac   2016-04-09 15:18:54

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  &  



上一篇:一键安装 Python 版 Shadowsocks 的最新版
下一篇:C/C++编译

The minute you think of giving up, think of the reason why you held on so long.