Let's say I have a directory dir with three subdirectories dir1 .. dir3. And inside I have many files and other subdirectories.
I'd like to search for a file inside, say with a *.c ending, but I'd only like to search in subdirectory "dir/dir2" and all its subdirectories. How can I formulate that?
Assuming I'm in dir/ I have:
find . -name "*.c"
to search in all directories.
How do I restrict to only dir2?
man findanswers your question in no time. – alex Dec 15 '10 at 13:36manapparently got much more spare time than we all do combined :) – alex Dec 15 '10 at 18:58mandoesn't :-) – Josh Dec 16 '10 at 14:11