Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find files modified after a particular date using find command

Status
Not open for further replies.

rasanth

Programmer
Apr 15, 2002
1
US
hi,
can anybody tell me how to find files that had been modified after a particular date pls? like if I want to find all files in the current dir modified after last sunday. is there any option in "ls" command using which i can do it?
thanks in advance,
Rasanth
 
Having you tried the "-t" or "-u" option ?
-t option sorts by the last modification
-u option sorts by the last access
you can use the -l option (long listing) along with either option
 
find . -mtime -5 -ls

will display all files modified in the last 5 days from this directory down ... this will also show any directories that have had modifications done in them ... like chmod'ing a file ( which doesn't change the file's mod time)
 
you can use "find dirname -mtime -number of days" and you will get the desired files including all subdirectories. The "-" before the number of days means that you will find all files that have been modified since (mtime works with "+" for files that have been modified before or with no sign to get the files that have been modified at a particular day). But: I think that mtime (like atime and ctime) is based on a 24h basis (i.e. find /home/jazz -mtime -3 will show you all files which have been modified within the last 72 hours)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top