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 % 

原文地址:https://www.cnblogs.com/sea-stream/p/14038753.html