I believe you're on the right track using `find` and a for/do loop. It'd be a good idea to show us what is the exact code you're currently using so that we might point out what you're doing wrong. Anyhow, here's the basic idea I'd use:
for location in $(find /path/to/super_parent_directory -type d -name "final_alignments"); do
( cd "$location"
So, it uses `find` to recursively search within the /path/to/super_parent_directory and locate directories
(that's what the -type d
is for) and it then (in a subshell) cd's into each final_alignments
directory that it finds, and executes the script.
If this doesn't work, please show us (copy & paste) from your terminal how you've used this code, and what the results and error messages are.