Tuesday, June 11, 2013

Linux find a file with wildcard directory and file name

I needed to find a directory which was deeply nested and I did not know the exact name of the directory.  Also I needed to find a file in that directory also with a wild card.

Here's my solution:

find /data -name "*crazydir" -type d -exec find {} -name "*crazyfile*" \; 2>/dev/null