Re: How to sort the output from find
From: Bryan Dongray (btd_at_dongrays.com)
Date: 09/21/03
- Next message: Steven Feil: "Enscript custom fancy headers"
- Previous message: Andreas Kahari: "Re: How to sort the output from find"
- In reply to: Julia Bell: "How to sort the output from find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Sep 2003 12:52:25 -0500
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?
If you're using Linux, the "stat" command is good for that:
find [...whatever...] -print | xargs stat -t | sort +11n
which tells sort to order based on the mtime column.
I do not know if all UNIX variants have "stat", or if they do if
that option exists or has the same column format. I have:
% uname -a
Linux tornado 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686 i386 GNU/Linux
% stat --version
stat (coreutils) 4.5.3
Written by Michael Meskes.
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Next message: Steven Feil: "Enscript custom fancy headers"
- Previous message: Andreas Kahari: "Re: How to sort the output from find"
- In reply to: Julia Bell: "How to sort the output from find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|