Re: How to sort the output from find

From: Andreas Kahari (ak+usenet_at_freeshell.org)
Date: 09/21/03


Date: Sun, 21 Sep 2003 11:16:40 +0000 (UTC)

In article <3F6D79BE.7000303@jpl.nasa.gov>, Julia Bell wrote:
> I'm using "find" to find a set of filenames that include a particular
> string. But, then I need a way to sort that list by date (ls -lrt of
> all the files that would found).
>
> Is there a straightforward way to do that?

For a moderate number of files, this wil probably do it:

    find /some/path -type f -name "pattern" -print | xargs ls -lrt

I say "moderate" since if 'find' finds too many files for one
single invocation of 'ls', it will invoke it twice or more
times. The files listed by 'ls' in one invocation will be
sorted the way you want.

-- 
Andreas Kähäri