博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
top后台执行显示:top: failed tty get 错误
阅读量:4318 次
发布时间:2019-06-06

本文共 562 字,大约阅读时间需要 1 分钟。

通过其他程序或脚本在非交互式模式下调用top命令,经常会出现:

   top: failed tty get 错误

解决办法:加个-b 选项皆可

-b : Batch mode operation

   Starts  top  in  <A1><AF>Batch mode<A1><AF>, 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 you<A1><AF>ve set with the <A1><AF>-n<A1><AF> command-line option or until killed.

例如执行:top -bn 1

nohup top -b | grep init >> top.log &  (top.log 内容显示的慢)

nohup /usr/bin/top -b | grep init >> top.log & (top.log内容显示的快)

转载于:https://www.cnblogs.com/felixzh/p/9020336.html

你可能感兴趣的文章
访问属性和访问实例变量的区别
查看>>
Spring MVC 异常处理 - SimpleMappingExceptionResolver
查看>>
props 父组件给子组件传递参数
查看>>
【loj6038】「雅礼集训 2017 Day5」远行 树的直径+并查集+LCT
查看>>
十二种获取Spring的上下文环境ApplicationContext的方法
查看>>
UVA 11346 Probability 概率 (连续概率)
查看>>
linux uniq 命令
查看>>
Openssl rand命令
查看>>
HDU2825 Wireless Password 【AC自动机】【状压DP】
查看>>
BZOJ1015: [JSOI2008]星球大战starwar【并查集】【傻逼题】
查看>>
HUT-XXXX Strange display 容斥定理,线性规划
查看>>
mac修改用户名
查看>>
一道关于员工与部门查询的SQL笔试题
查看>>
Canvas基础
查看>>
[Hive - LanguageManual] Alter Table/Partition/Column
查看>>
可持久化数组
查看>>
去除IDEA报黄色/灰色的重复代码的下划波浪线
查看>>
Linux发送qq、网易邮件服务配置
查看>>
几道面试题
查看>>
【转】使用 WebGL 进行 3D 开发,第 1 部分: WebGL 简介
查看>>