shell grep搜索出包含指定内容的行

code

macname@localhost Desktop % cat a.txt 
1dededede
2dedefrfr
3frhvfvfvf
4frfrdede
5frfrfrfrf
6frfrede
7jukitttt
8csxssss
9zaxss
10swwww
11ssssss
12aaaaa
macname@localhost Desktop % grep 2 a.txt |wc -l
       2
macname@localhost Desktop % grep 3 a.txt       
3frhvfvfvf
macname@localhost Desktop % 
macname@localhost Desktop % grep 3 a.txt |wc -l
       1
macname@localhost Desktop % 

 

 

 

 

 

posted @ 2020-11-25 21:09  anobscureretreat  阅读(1175)  评论(0编辑  收藏  举报