Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Recursive folder search faster than find?

$
0
0
I'm trying to find folders created by a propritary data aquisition software with the .aps ending--yes, I have never encountered folder with a suffix before (some files also end in .aps) and sort them by date. I need the whole path

ls -dt "$dataDir"*".aps" does exactly what I want except for the recursion. find "$dataDir" -type d -name '*.aps' does everyting but is excruciatingly slow on windows remote shares. It takes about 45 seconds to find 27 folders. 8 are one subdirectory below $dataDir and one is 2 subdirectories lower. There are a few hundred files and each .aps folder has 7 subfolders with a bunch of files (many called setup.aps which seems to be slowing the find). I know I can get use the printf inside find to get a date column and sort and cut it but it would be even slower.

ls -dt does everything I want except the recursion. the -R option in ls is a completely different animal and does not do the kind of recursion I'm looking for. -1R is sometimes useful but in the above command it does nothing.

Viewing all articles
Browse latest Browse all 16232

Trending Articles