autodataming的个人博客分享 http://blog.sciencenet.cn/u/autodataming

博文

grep

已有 1674 次阅读 2018-9-25 16:14 |系统分类:科研笔记

 仅仅输出文件名 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




https://wap.sciencenet.cn/blog-950202-1136915.html

上一篇:linux下优雅地使用python
下一篇:python %s 适合于多种类型
收藏 IP: 202.127.19.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 19:43

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部