I ran the following from the base folder. /
find . -name *.xvi.txt | sort
Returns the following sort order:
./LT/filename.2004167.xvi.txt ./LT/filename.2004247.xvi.txt ./pred/2004186/filename.2004186.xvi.txt ./pred/2004202/filename.2004202.xvi.txt ./pred/2004222/filename.2004222.xvi.txt
As you can see, the file names follow the usual structure, but the files themselves can be located in different parts of the directory structure. Is there a way to ignore folder names and / or directory structure so that sorting returns a list of folders / file names based ONLY on the file names themselves? For instance:
./LT/filename.2004167.xvi.txt ./pred/2004186/filename.2004186.xvi.txt ./pred/2004202/filename.2004202.xvi.txt ./pred/2004222/filename.2004222.xvi.txt ./LT/filename.2004247.xvi.txt
I tried several different switches under the find and sort commands, but no luck. I could always copy everything into one folder and sort from there, but there are several hundred files, and I hope there is a more elegant option.
Thanks! Your help is appreciated.
source share