Computing.Net > Forums > Unix > old files compare date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

old files compare date

Reply to Message Icon

Name: jemdda
Date: May 20, 2004 at 19:38:15 Pacific
OS: hp ux
CPU/Ram: hp
Comment:

Hi, the below command searches for files older than today in a directory and also subdirectories. I want to restrict the search to the current directory only. Any ideas? Thanks
find /path/to/search -type f -mtime +1.



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: May 20, 2004 at 23:12:56 Pacific
Reply:

Hi:


If your version of find has the prune option try this:

find /searchdir \( -type d ! -name . -prune \) -o \( -type f -print \) | awk ' gsub("^./","") '

GNU find has a maxdepth option, that works like this:

find /searchdir -type f -maxdepth 1 -print | awk ' gsub("^./","") '

Regards,

Nails



0
Reply to Message Icon

Related Posts

See More


driver for extra buttons ... shell script to write mai...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: old files compare date

findig files with date extensions www.computing.net/answers/unix/findig-files-with-date-extensions/7900.html

Deleting old files www.computing.net/answers/unix/deleting-old-files/4621.html

Comparing time/date of a file... www.computing.net/answers/unix/comparing-timedate-of-a-file/3711.html