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


/some/dir/number/blah/supercrazydir/crazyfile.123.log
/some/other/dir/haha/antohercrazydir/crazyfile.234.log
/yet/another/crazydir/crazyfile.999.log

Comments

Popular Posts