adplus-dvertising

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

Asked 11 years ago
Viewed 3.24 k times

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

asked 11 years ago

Correct Answer

Use find:

find . -name "foo*"

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

answered 6 years ago

Other Answer

Piping find into grep is often more convenient; it gives you the full power of regular expressions for arbitrary wildcard matching.

For example, to find all files with case insensitive string "foo" in the filename:

~$ find . -print | grep -i foo
answered 11 years ago