10年 Java程序员,硬核人生!勇往直前,永不退缩!

欢迎围观我的git:https://github.com/R1310328554/spring_security_learn 寻找志同道合的有志于研究技术的朋友,关注本人微信公众号: 觉醒的码农,或Q群 165874185

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

执行 nohup top &
nohup.out 显示

top: failed tty get

+++++++++++++++++

top后台执行显示:top: failed tty get 错误 2009-03-12 21:06:52

分类: LINUX

通过其他程序或脚本在非交互式模式下调用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

这样就可以了:

nohup top -b &

posted on 2017-05-31 14:25  CanntBelieve  阅读(805)  评论(0编辑  收藏  举报