in reply to smart glob of dated subfolders

It really depends on how up-to-date your information has to be.

On my home storage (which has my accumulated digital junk of the past 25 or so years on slow, rotating disks), i run something like this periodically:

find /media/large -type f > /media/large/filelist.txt find /media/large -type d > /media/large/dirlist.txt
Edit: '-type d' for directories.

Doing a "find" can take 30+ seconds, but

cat filelist.txt | grep -i myfirstquad | grep jpg
is a sub-second operation.

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

Replies are listed 'Best First'.
Re^2: smart glob of dated subfolders
by tybalt89 (Monsignor) on Feb 27, 2023 at 22:23 UTC

    I'm sure you meant to type

    find /media/large -type d > /media/large/dirlist.txt
    and also for Linux systems there's a 'locate' so that
    locate -i myfirstquad | grep jpg
    should work as well. At least on my system, 'locate' gets refreshed once a day, or you can refresh it any time by running 'updatedb'.

      Thanks for catching the find typo.

      As for "locate": This works fine locally. But in my case, the storage is mounted over NFS on my workstation. Scanning the whole thing over the network is quite slow. So the storage itself (also running Linux) is making those 2 files and providing them in the NFS mount.

      PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP