× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




ls -ltur --full-time | grep 2005-10-14 | awk '{print $9}'
Now we print out just the ninth column of data resulting in:
dead.letter

Problems with this approach

a) If you had a file containing the characters "2005-10-14" it would be included in the list, even if the access time was different. For example "minutes_from_2005-10-14_meeting.pdf"

There are lots of examples of files that are created with dates as part of the name. Using GREP in this capacity is not smart.

b) Your awk statement separates the names based on spaces. That means that spaces in teh filename would screw everything up. For example "minutes from 2005-10-14 meeting.pdf" would yield the word "minutes", instead of the complete filename.

c) As you pointed out, this still only gives you one date, not everything before or after a certain date. What people tend to use these things for is cleaning up old files. Files that haven't been used in 90 days get deleted (as an example)

With your approach, you'd have to generate a list of every date in the last 90 days -- and that would be more work than writing a proper script to do the job.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.