2010/1/2 erik quanstrom <quans...@quanstro.net>: >> and /sys/src isn't by any means the largest tree i like to grep >> (for instance, searching for lost files with a name i longer remember, >> i've been known to search through all the files in my home directory, >> ~425000 files at last count) >> >> sometimes i think it would be nice if du had a breadth-first option. > > aren't you contridicting yourself? at 128 characters/file, > that's only 52mb -- 2% of memory on a typical system these days. > why can't it be passed as an argument list?
i'm not saying it can't be passed in an argument list, just that xargs gives you a lazy evaluation of the walk of the file tree which can result in a faster result when the result is found earlier in the file list. that's why breadth-first might be useful, by putting shallower files earlier in the search results - i often do grep foo *.[ch] */*.[ch] */*/*.[ch] to achieve a similar result, but you have to guess the depth that way.