Browse - Computer Tips - How do I find files in a bunch of subfolders?
OS: Linux, Unix
Q. How do I find files in a bunch of subfolders?
A. For years I composed "find" commands to do this sort of
thing. For example:
find . -name \*.conf
But check out this way of doing it:
More compact and easier to understand.
For some reason I had never thought of using multiple stars
in one command. Notice that bash is smart enough to evaulate
the second star in each subfolder!
The find command will list .conf files in the /etc folder.
While the ls doesn't. Perhaps this is what you want.
Of course, find will look in a unlimited number of subfolders
(unless you use -maxdepth) and the ls only looks down one.
But sometimes is is exactly what you want.