当前位置:网站首页>巧妙利用unbuffer实时写入
巧妙利用unbuffer实时写入
2022-08-01 07:37:00 【早九晚十二】
大家好,我是早九晚十二,目前是做运维相关的工作。写博客是为了积累,希望大家一起进步!
我的主页:早九晚十二
场景描述
我们常常在写脚本时,会涉及到一些比较耗时的操作,当要输出日志时,没办法实时获取命令的进度,进而不好判断脚本的流程,这时,就引出了unbuffer命令。
实际应用
比如我现在需要查找根目录下所有的以1为名字的文件,正常情况下我们是find / -name haha
,等命令执行完毕后才能看到所有haha的路径,我们加下重定向,即为如下这种情况
如果加上unbuffer后可以很快地看到每条输出的结果
安装
yum直接安装即可,注意要用root权限
yum -y install expect
码字不易,希望大家有用到的可以三连支持一波。哪里有问题的话可以指出,谢谢大家!
边栏推荐
- Data organization -- singly linked list of the linear table
- 聊一聊ICMP协议以及ping的过程
- POJ2031空间站题解
- Case practice --- Resnet classic convolutional neural network (Mindspore)
- Monitor the width and height of the parent element, adapt to the size of the plug-in
- pytest接口自动化测试框架 | 使用函数返回值的形式传入参数值
- How to generate and configure public key certificate in Alipay
- 数据分析6
- Dbeaver connect the MySQL database and error Connection refusedconnect processing
- 配置我的kitty
猜你喜欢
Offer brush questions - 1
Offer刷题——1
Golang:go开启web服务
"By sharing" northwestern university life service | | bytes a second interview on three sides by HR
Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice
拳头游戏免版权音乐下载,英雄联盟无版权音乐,可用于视频创作、直播
Golang: go static file processing
Dbeaver connect the MySQL database and error Connection refusedconnect processing
七夕来袭——属于程序员的浪漫
NIO programming
随机推荐
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图可视化股票月收益率数据、使用百分比显示Y轴坐标数据、使用不同的色彩表征正负收益率
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
22 Grab the Seat 1 C.Grab the Seat (Geometry + Violence)
MATLAB program design and application of MATLAB 2.5
我的创作纪念日
图像基本操作的其他内容
C语言学习概览(三)
Electromagnetic compatibility introductory tutorial (6) test project
金山打字通 官网 下载
pytest接口自动化测试框架 | 跳过测试类
小程序通过云函数操作数据库【使用get取数据库】
"By sharing" northwestern university life service | | bytes a second interview on three sides by HR
pytest接口自动化测试框架 | parametrize中ids的用法
选择排序—直接选择排序和堆排序
VSCode 快捷键及通用插件推荐
如何使用Photoshop合成星轨照片,夜空星轨照片后期处理方法
数据分析5
Offer brush questions - 1
旋度(7)连接失败localhost8080;连接拒绝了
USB 协议 (二) 术语