top后台执行显示:top: failed tty get 错误

jackxiang 2016-1-10 15:50 | |
背景:想用户登录ssh到linux时发邮件里有top,但发现出现top: failed tty get 错误 。
通过其他程序或脚本在非交互式模式下调用top命令,经常会出现:
   top: failed tty get 错误
解决办法:加个-b 选项皆可
-b : Batch mode operation
   Starts  top  in  Batch mode, which could be useful for sending output from top to other programs or to a file.  In this mode, top will not accept input and runs until the iterations limit youve set with the -n command-line option or until killed.
例如执行:top -bn 1


通过其他程序或脚本在非交互式模式下调用top命令,经常会出现:
   top: failed tty get 错误
解决办法:加个-b 选项皆可
-b : Batch mode operation
   Starts  top  in  Batch mode, which could be useful for sending output from top to other programs or to a file.  In this mode, top will not accept input and runs until the iterations limit youve set with the -n command-line option or until killed.
例如执行:top -bn 1


来自:http://blog.chinaunix.net/uid-9554532-id-2000668.html

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/8437/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]