Xref: utzoo comp.unix.questions:7667 comp.unix.wizards:9499 Path: utzoo!attcan!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: -since option for ls -lt Keywords: options ls find Message-ID: <507@philmds.UUCP> Date: 17 Jun 88 13:27:28 GMT References: <344@ajpo.sei.cmu.edu> <10981@cgl.ucsf.EDU> <355@conexch.UUCP> Reply-To: leo@philmds.UUCP (L.J.M. de Wit) Organization: Philips I&E DTS Eindhoven Lines: 30 In article <355@conexch.UUCP> root@conexch.UUCP (Larry Dighera) writes: >In article <10981@cgl.ucsf.EDU> seibel@hegel.mmwb.ucsf.edu.UUCP (George Seibel) writes: [lines deleted]... 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. If you reverse the find and the ls, you get a much faster one: ls -l `find . -ctime -n -print` Only one ls needed for all the files (the former solution fires up an ls for each file that satisfies the condition); you could even use it to exclude subdirectories, although find will do recursion: ls -l `find . -ctime -n -print|sed '/\/.*\//d'` i.e. sed removes lines containing two or more /'s. Not to be recommended for deep nesting! Leo.