I would like to look for files in certain sub-directories in order to avoid looking into possibly big ones.
The subdirectories to search are created monthly following the convention YYYYMM.
You don't see any output from your original command because you're pruning the starting (.) directory.
You can exclude every directory not named 2[0-9][0-9][0-9][0,1][0-9] only for a known number of levels,
because otherwise you will also exclude the parent of the directories you're interested in.
---------- Post updated at 12:34 PM ---------- Previous update was at 12:13 PM ----------
You can use something like this, but it will fail if there are white spaces or other special characters in the directory names
or if the list returned exceeds the ARG_MAX limit of your OS.
find $(find . -name '2[0-9][0-9][0-9][01][0-9]' -type d) -type f
I mean you're probably right about the reason for the absence of output so i just figured a starting directory matching the regular expression should not be pruned and therefore the command should return something. I've tried it and it's not the case.
Never mind, i'll use 2 find commands as suggested by ygemici or in your last post. Thank you both for your help
-L max-lines
Use at most max-lines nonblank input lines per command line.
Trailing blanks cause an input line to be logically continued
on the next input line. Implies -x.
You are correct about skipping $0, so I'd like to change my answer to:
find . -name '2[0-9][0-9][0-9][01][0-9]' -type d -print | xargs sh -c �find "$@" -type f -print' --