|
仅仅输出文件名 grep -l print *py
输出含有print的脚本的文件名
使用grep获取文件中的最后一次匹配项
grep Time md.part0003.log -A 2 |tail -n3
grep '查找的内容' -A 500 文件名 | tail -n 501
如何配合watch 监控管道命令,单引号封装管道
watch 'grep Time md.part0003.log -A 2 |tail -n3 '
或者把管道命令写到脚本文件中1.sh
watch sh 1.sh
#### 参考
1. https://blog.csdn.net/qq_27686779/article/details/84102141
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 22:24
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社