我想用–output写入一个文件,以便稍后制作一个图形,而不是使用“>” *** 作符.
解决方法 您可以使用命令| grep specific_text例如test dstat | grep木偶
为了将输出结果保存在日志文件中,您有两个选项:
使用 – 输出文件
dstat –time –cpu –top-cputime –output /tmp/dstat.log | grep木偶
使用命令>文件
dstat –time –cpu –top-cputime> /tmp/dstat.log | grep木偶
对于appendind日志:
dstat –time –cpu –top-cputime>> /tmp/dstat.log | grep木偶
这是这两个命令的screenshots
根据您的意见,这些命令可以帮助您:
(1)将数据保存在文件中dstat –time –cpu –top-cputime –output my.log
(2)应用过滤日志文件并将结果保存到文件cat my.log | grep httpd> myhttpd.log
(3)最终结果cat myhttpd.log
看到结果@L_404_1@的屏幕截图
总结以上是内存溢出为你收集整理的linux – 一个特定进程的Dstat CPU使用情况全部内容,希望文章能够帮你解决linux – 一个特定进程的Dstat CPU使用情况所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)