Assuming you want to do a recursive search using find
in each of the bad
directories that are a level below directory called Main Directory
:
find 'Main Directory'/*/bad ...rest of find options...
I've left the rest of the find
options out because you never say what you want to search for.
find
is able to take more than one directory as the starting point for its search. Here, we give it a filename globbing pattern that will be expanded by the shell to the paths of the various bad
directories.
Assuming you just want to print the pathnames of all the (regular) files in or beneath those directories:
find 'Main Directory'/*/bad -type f
If the bad
directories do not have any subdirectories that you need to look inside, and if the number of files that you need to process is not many thousands, you would be able to just use
'Main Directory'/*/bad/*
(where the final *
is assumed to match the filenames of the files you need to process) with whatever utility you need to use. For example, with ls
:
ls 'Main Directory'/*/bad/*
ls */*/bad/
work to your satisfaction?