linux文件内容查找高级命令 grep egrep fgrep
linux 内容的搜索模式:grep
1028 getp -nR "var" /etc/passwd>>word.txt
1029 grep -nR "var" /etc/passwd>>word.txt
linux 内容的搜索模式:egrep
1031 egrep "N(o|e)+" /etc/passwd
1032 egrep "(a|c)*x" /etc/passwd
1033 egrep "(a|c)x" /etc/passwd
1034 egrep "(i|c)x" /etc/passwd
linux 内容的搜索模式:fgrep
1037 fgrep '*' /etc/passwd
1038 fgrep 'v' /etc/passwd
三个命令都差不多的功能,部分好坏,egrep fgrep 用 grep也能实现
cat /etc/passwd | grep "var" | wc
文件内容的查找 计算行数和出现的次数