How can I recursively find all files in current and subfolders based on wildcard matching?
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Invoking Mirth Connect CLI with Powershell script
- Error building gcc 4.8.3 from source: libstdc++.so
If you want to search special file with wildcard, you can used following code:
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.Following command will list down all the files having exact name "pattern" (for example) in current and its sub folders.
find ./ -name "pattern"
find
will find all files that match a pattern:However, if you want a picture:
Hope this helps!
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
Use find for that:
find
needs a starting point, and the.
(dot) points to the current directory.for file search
find / -xdev -name settings.xml
--> whole computerfind ./ -xdev -name settings.xml
--> current directory & its sub directoryfor files with extension type