[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find and glob
From: |
Mark Hills |
Subject: |
find and glob |
Date: |
Tue, 27 Mar 2012 14:24:42 +0100 (BST) |
We traverse portions of our filesystem and apply a find action to them;
currently by allowing the shell to expand the glob; eg.
find ./*/xx/*/yy
But the expansion can be large and problematic before being passed to
find.
To do the equivalent in find itself is slow. The whole hierarchy is
traversed (which is slow), and only matching results displayed:
find . -path './*/xx/*/yy'
Is there a way to have find itself only visit the relevant portions of the
filesystem?
The manual [1] seems to suggest using locate and xargs. Keeping an index
is not practical for us, so I wrote a simple command around the glob(3)
function to do the traversal and print to stdout. Am I missing some well
established method here?
Please keep me CC'd, as I read from the archives. Many thanks.
[1]
http://www.gnu.org/software/findutils/manual/html_mono/find.html#Fast-Full-Name-Search
--
Mark
- find and glob,
Mark Hills <=