linux列出包含指定字符(同时指定多个字符)的文件
001、
root@PC1:/home/test# ls ## 3个测试文件 a.txt b.txt c.txt root@PC1:/home/test# cat a.txt a j 6 b d j root@PC1:/home/test# cat b.txt 3 7 k j x v root@PC1:/home/test# cat c.txt i 8 k 6 a d root@PC1:/home/test# grep -l -E "a|b" * ## 同时列出包含a或者b的文件 a.txt c.txt

002、
root@PC1:/home/test# ls ## 3个测试文件 a.txt b.txt c.txt root@PC1:/home/test# cat a.txt a j 6 b d j root@PC1:/home/test# cat b.txt 3 7 k j x v root@PC1:/home/test# cat c.txt i 8 k 6 a d root@PC1:/home/test# grep -l -E "k|v" * ## 同时输出包含k或者v的文件 b.txt c.txt


浙公网安备 33010602011771号