[Dclug] Recursively listing files by some category
dturvene at comcast.net
Wed May 21 12:49:36 EDT 2008
On Wed, 2008-05-21 at 04:23 -0700, Gururajan Ramachandran wrote:
> A line such as:
> find . -type f -print | xargs -n 600000 ls -lart
> works upto a certain point. At some point something
> like this runs out of shell buffer space if the number
> of files and directories are large enough.
> Are there any utilities that can recursively list
> files sorted by some category (date or size or etc...)
> irrelevant of the number of files?
Well, it certainly seems like a buffer exhaustion problem but are you
sure? What is the error code? I'm guessing 123 - which could mean a
number of things.
There are many solutions to get around the common problem (which means
Google is your friend) of shell buffer limits . Have you experimented
with the find "-exec" option? Perl or Python scripts are great
solutions, and fairly efficient. Maybe do several find commands, each
on a different directory branch? Here's a simple, but very slow, bash
rm -f $CMDOUT
find . -type f > $FINDOUT
exec < $FINDOUT
while read filename; do
ls -lart $filename >> $CMDOUT
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dclug