Recursive folder search faster than find?

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.

You are kinda stuck. The handling of your request lives on the other side. The problem is - what happens on the windows side? Changing commands on UNIX is not going to help much.

I am assuming you are using CIFS/samba, try: Faster Samba (SMB / CIFS) Share Performance - Eggplant Systems and Design

I'm working under Cygwin64 in a all-Windows corporate environment. (This utility runs side by side with the data aquisition software allowing users to edit run names, comments, validate/invalidate/exclude data. The propritary software is so user unfriendly and clunky (I guess that's what the thousands of dollars is for :slight_smile: ). I happen to have special privilages on the share drive I am using for development but won't for the deployed system.

ls is plenty fast but I can't do the recursion. Not sure what other commands are out there. On the plus side, I have some really fast hardware to run on :slight_smile:

Mike

---------- Post updated at 11:32 AM ---------- Previous update was at 11:14 AM ----------

part of it is windows file sharing. It takes about 0.6 seconds vs 45 seconds on my local machine. However, find itself is dozens of times slower than ls.

Mike

---------- Post updated at 11:45 AM ---------- Previous update was at 11:32 AM ----------

I'm living with find find "$dataDir" -type d -name '*.aps' -printf '%T@|%p\n' | sort -nr | cut -d"|" -f 2 ("|"being an windows disallowed path character) until one of the forum Awk or Perl deities pops in :slight_smile: It is taking no longer than the find itself (~45 seconds).

Mike