Problem: You need to use the Unix/Linux find command to search multiple folders. Specifically, you'd like to search several folders beneath your current location, but not all folders.
For example, your current directory may have 20 subdirectories, and you don't want to search them all like this:
find . -name "*.java"
find * -name "*.java"
To search multiple subdirectories with the
find command, but not all of them, specify their names at the beginning of the
find command. For instance, if you want to search two folders named
bar for all "*.java" files, use this command:
find foo bar -name "*.java"
And if you want to search three folders named
baz for all "*.rb" files, use this command:
find foo bar baz -name "*.rb"
There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.
Hi...Its too good info for the beginnners..keep posting advances concepts....