[Wylug-discuss] Copy files by date

linux at sh2515.plus.com linux at sh2515.plus.com
Wed Jan 25 17:15:31 UTC 2012


1st thanks all for replying.

> Smylers <Smylers at stripey.com> wrote:
>> FreeBSD's date command doesn't have --date, so I suspect OS X's doesn't
>> either, unfortunately.
>
> True.  But there's a workaround in this case:
>
> $ /usr/bin/uname -sr
> Darwin 10.8.0
> $ /bin/date
> Wed 25 Jan 2012 14:38:44 GMT
> $ /bin/date -v -1d +'%F'
> 2012-01-24
>
> The -v option to date(1) in FreeBSD and Mac OS X takes an "adjustment"
> to apply to the date before printing it; in this case, we adjust by
> subtracting one day ("-1d").  Then the %F date format shows just the
> date, as desired.

2nd how would I use this code against a file date?

>
>> Maybe simply installing Gnu tools would be the best way round this?
>
> Yes, often.

3rd with regards to install GNU tools on our systems, it's not going to
happen as it is a temp solution for moving buildings and the IT is run by
3 different IT people for 3 different departments.

Scott




More information about the Wylug-discuss mailing list