-since option for ls -lt

Larry Dighera root at conexch.UUCP
Thu Jun 9 02:06:11 AEST 1988


In article <10981 at cgl.ucsf.EDU> seibel at hegel.mmwb.ucsf.edu.UUCP (George Seibel) writes:
>In article <344 at ajpo.sei.cmu.edu> jrkelly at ajpo.sei.cmu.edu (John Kelly) writes:
>>
>>In VMS and TOPS-20, the directory listing commands have a /since option that
>>allows one to easily obtain a list of files modified since a specified time
>>and date.  [...]
>
>I also find this a very useful thing to have.  After the e/f/grep mess is
>cleaned up, maybe someone will do some work on ls.  In the meanwhile, I
>find the following alias very helpful:
>alias lst5 ls -lst | head -6
>This shows you the 5 newest files, plus the total space used in the directory.

I didn't see the original article that spawned this discussion, but it is a
simple matter to get a listing of the files that have been changed within
n days.  Try this:
 
        find . -ctime -n -exec ls -l {} \;

Where n is the number of days.  Use -n to see all files newer than n-days
old, and +n to see all files older n-days old.  You can also use all the
other useful options to find like -type, -user, -size, ...
 
There is a problem with this approach however, there's no way that I am aware
of to prevent find from descending the directory tree.  There's yet another
option that would be useful for find.

Best Regards,
Larry Dighera

-- 
USPS: The Consultants' Exchange, PO Box 12100, Santa Ana, CA  92712
TELE: (714) 842-6348: BBS (N81); (714) 842-5851: Xenix guest account (E71)
UUCP: conexch Any ACU 2400 17148425851 ogin:-""-ogin:-""-ogin: nuucp
UUCP: ...!uunet!turnkey!conexch!root || ...!trwrb!ucla-an!conexch!root



More information about the Comp.unix.wizards mailing list