当前位置:网站首页>巧妙利用unbuffer实时写入
巧妙利用unbuffer实时写入
2022-08-01 07:37:00 【早九晚十二】
大家好,我是早九晚十二,目前是做运维相关的工作。写博客是为了积累,希望大家一起进步!
我的主页:早九晚十二
场景描述
我们常常在写脚本时,会涉及到一些比较耗时的操作,当要输出日志时,没办法实时获取命令的进度,进而不好判断脚本的流程,这时,就引出了unbuffer命令。
实际应用
比如我现在需要查找根目录下所有的以1为名字的文件,正常情况下我们是find / -name haha,等命令执行完毕后才能看到所有haha的路径,我们加下重定向,即为如下这种情况


如果加上unbuffer后可以很快地看到每条输出的结果

安装
yum直接安装即可,注意要用root权限
yum -y install expect
码字不易,希望大家有用到的可以三连支持一波。哪里有问题的话可以指出,谢谢大家!
边栏推荐
- zip package all files in the directory (including hidden files/folders)
- 华为深度学习课程第九章——卷积神经网络以及案例实践
- 上课作业(7)——#598. 取余运算(mod)
- How to use Photoshop to composite star trail photos, post-processing method of night sky star trail photos
- NIO programming
- 配置我的kitty
- crypto-js uses
- 微信小程序请求封装
- sum of special numbers
- 【HDLBits 刷题】Circuits(1)Combinational Logic
猜你喜欢

第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】

MATLAB program design and application of MATLAB 2.5

Detailed explanation of the crawler framework Scrapy

VoLTE基础学习系列 | 什么是SIP和IMS中的Forking

Guest brush SQL - 2

小程序全面屏手势配置案例

最小生成树

22 Grab the Seat 1 C.Grab the Seat (Geometry + Violence)

Dart exception details

爬虫框架 Scrapy 详解
随机推荐
05-SDRAM:仲裁
拳头游戏免版权音乐下载,英雄联盟无版权音乐,可用于视频创作、直播
电磁兼容简明教程(6)测试项目
centos 安装php7.4,搭建hyperf,转发RDS
图像基本操作的其他内容
crypto-js uses
Zero-code website development tool: WordPress
The Bean's life cycle
好的plm软件有哪些?plm软件排行榜
七夕来袭——属于程序员的浪漫
C语言学习概览(三)
Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
金山打字通 官网 下载
我三本学历,五面阿里,被面试官“供”着出来了,拿了33*15的Offer
The socket option
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的pad_fn函数与gt::fmt函数一起用于填充包含数值的特定列、对数据列的数值进行十进制对齐(从小数点对齐)
pytest接口自动化测试框架 | 跳过模块
最小生成树
Golang: go to connect and use mysql

