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

Find without going into sub-dirs

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
0
0
US
Is there a way to run "find" so it reports all files/subdirs under a directory that are over X days old without transposing through all the subdirs?

example
under /X
/X/Y/Z
/X/A/B/C/D
/X/A/E/I/O/U

I would like it to report back only if Y and A have a date stamp older then 30 days.
 
Found a work-around... Sloppy, but it will do...

cd /X
find * -type d -mtime +60 | grep -v /
 
Code:
find * -type d -prune -mtime +60
should do the trick.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top