1

Find: Reference to Current Directory

view story
linux-howto

http://unix.stackexchange.com – I'm trying to use find with the regex option. However my regular expression only captures the basename of the file. Is there a reference to the "directory find is currently in" I can use in my regular expression so that I don't have to account for it by means of a leading .*? (I'm looking for something like the $File::Find::dir in perl's File::Find module.) As an example: suppose I want to find all files matching the regular expression baz\d anywhere below /foo/bar/. Using find /foo/bar -regex 'baz\d' won't find a file named baz1 at /foo/bar/ because the pattern baz\d doesn't match the full (HowTos)