Unix shell script/command help needed...
Hi all.
I need some help with the following scenario...
I have this directory structure:
/Dir 1/Dir 2/Dir 3/Dir X/Dir 5/Dir 6/files
/Dir 1/Dir 2/Dir 3/Dir Y/Dir 5/Dir 6/files
/Dir 1/Dir 2/Dir 3/Dir Z/Dir 5/Dir 6/files
Is there a way to list all the files in each path without me having to type the whole path out into the terminal?
I know ls -1 /Dir 1/Dir 2/Dir 3 will list the directories Dir X, Dir Y and Dir Z on separate lines (with no recursion).
Is there a way to insert each separate item that is listed into a find command to search for a file of type *.txt for example?
eg: find /Dir 1/Dir 2/Dir 3/ITEM/Dir 5/Dir 6/ -name *.txt
where ITEM would be the output from the ls command.
All the directory paths have a common path up to Dir X and then the remainder of the path is also common too.
Thanks in advance.
|