开发者

Using Grep to get the line that had the match and the following line

开发者 https://www.devze.com 2023-03-03 00:09 出处:网络
I have a file of records. The first line has the name and the following line has the data associated with that person. I want to gre开发者_运维问答p for a persons name and get the line with the name a

I have a file of records. The first line has the name and the following line has the data associated with that person. I want to gre开发者_运维问答p for a persons name and get the line with the name and the line that follows.


grep -A 1 "person name" fileName


grep -C1 regex filename

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号