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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving only old files from a directory

Status
Not open for further replies.

antman03

Programmer
Feb 5, 2003
8
US
Hi all,

I am trying to get a get a list of files which are over a certain date, I am aware that " ls -c -t " will sort files and bring back the newest files first in a directory but I need only those that are older than a certain date (that is not all of them).

I suppose I need to supply a parameter of some type but I can´t work out how, anyone got any pointers? thanks

Anthony
 
[tt]touch -t 200306271135 /tmp/find
find . -newer /tmp/find[/tt]
would give you a list of all files which have been modified since 27th of June 2003 at 11:35 AM.

//Daniel
 
e.g.
#find modified files more than 10 days in /tmp directory

find /tmp -mtime +10 -print

#find a user's files which changed within 2 days in /tmp directory and remove it.

find /tmp -user userA -ctime -2 -exec rm {} \;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top