首页 > 解决方案 > Linux 使用“watch”和 tqdm 进行日志监控

问题描述

这是一个正常的输出:

$grep -E '.*status' api_logging.log | tqdm --total=808 --desc='TOTAL'|wc -l

TOTAL: 100%|█████████████████████████████████████████| 808/808 [00:00<00:00, 529365.45it/s]
808

但我想继续监控:如何隐藏第一行输出?

$watch -n 1 grep -E '.*status' api_logging.log | tqdm --total=808 --desc='TOTAL'|wc -l

TOTAL:   0%|                                    | 0/808 [00:00<?, ?it/s]
TOTAL: 100%|████████████████████████████████████| 808/808 [00:00<00:00, 327466.81it/s]

标签: linuxshellwatchtqdm

解决方案


推荐阅读