Linux查找某个目录下包含特定字符串的文件

linux下搜索带有指定字符串的文件 , 

查询当前目录下包含有192.168.1.2:1521的文件

find ./  -type f | xargs grep '192.168.1.2:1521'

[root@CS1 local]# find . -type f | xargs grep '192.168.1.2:1521'
./aa.txt:rgs grep 192.168.1.2:1521
[root@CS1 local]# ll
total 68
-rw-r--r--. 1 root root   26 Mar 27 22:46 aa.txt
[root@CS1 local]# cat aa.txt 
rgs grep 192.168.1.2:1521

猜你喜欢

转载自blog.csdn.net/u013792404/article/details/88864399