How can I recursively find all files in current an

2019-01-08 02:17发布

How can I recursively find all files in current and subfolders based on wildcard matching?

标签: linux shell
13条回答
狗以群分
2楼-- · 2019-01-08 03:02

If you want to search special file with wildcard, you can used following code:

find . -type f -name "*.conf"

Suppose, you want to search every .conf files from here:

. means search started from here (current place)
-type means type of search item that here is file (f).
-name means you want to search files with *.conf names.

查看更多
beautiful°
3楼-- · 2019-01-08 03:05

Following command will list down all the files having exact name "pattern" (for example) in current and its sub folders.

find ./ -name "pattern"

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-01-08 03:08

find will find all files that match a pattern:

find . -name "*foo"

However, if you want a picture:

tree -P "*foo"

Hope this helps!

查看更多
我只想做你的唯一
5楼-- · 2019-01-08 03:11

Below command helps to search for any files

1) Irrespective of case
2) Result Excluding folders without permission
3) Searching from the root or from the path you like. Change / with the path you prefer.

Syntax :
find -iname '' 2>&1 | grep -v "Permission denied"

Example

find / -iname 'C*.xml' 2>&1 | grep -v "Permission denied"

find / -iname '*C*.xml'   2>&1 | grep -v "Permission denied"
查看更多
Root(大扎)
6楼-- · 2019-01-08 03:13

Use find for that:

find . -name "foo*"

find needs a starting point, and the . (dot) points to the current directory.

查看更多
闹够了就滚
7楼-- · 2019-01-08 03:14

for file search
find / -xdev -name settings.xml --> whole computer
find ./ -xdev -name settings.xml --> current directory & its sub directory

for files with extension type

find . -type f -name "*.iso"
查看更多
登录 后发表回答