linux - 一起使用 watch , tail 和 ccze

标签 linux bash shell monitoring

我像这样一起使用了 watch 和 tail:

watch -n 5 tail -n 15 mylogfile.txt

我还使用 tail 和 ccze 对日志文件进行着色,如下所示:

tail -f -n 50 mylogfile.txt | ccze

但我不知道如何在一个命令中同时使用这三个功能。有人有任何想法吗?

最佳答案

最新版本的 watch 有 -c | --color 选项,所以也许这对您有用:

watch -n 5 -c 'tail -f -n 50 mylogfile.txt | ccze'

关于linux - 一起使用 watch , tail 和 ccze,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35670204/

相关文章:

linux - 将 SSH key 添加到 authorized_keys : permission denied(publickey)

linux - 从检查 ls-l 输出中删除文件的能力

bash - 删除 bash 脚本中的回车符,或在使用 mv/mkdir 时忽略它

python - python的测试工具

c - libmemcached 问题

linux - 将 bash 变量分配给 X 或 Y

linux - 同时执行 awk 和 sed 命令

Bash 语法错误 : unexpected end of file

linux - 如何计算名称中包含元音的文件数

regex - 如何在grep中进行非贪婪匹配?