I would like to make a shell script that updates the modified date on a directory and files. This is because I have realised that when you download a file it has the date from when it was uploaded. For example when I downloaded the cvim plugin for vim the date was 15 Dec 2008. I would like a script that will change that date to the current time.
Thanks
Just use
touch file
to update the last modified time stamp. If your downloader can write to stdout this is even simpler:
downloader http://someURL > file
because a newly created (or replaced) file has always the current time as the last modified time.
For directories, you can create and remove a dummy file to update its last modified time stamp:
touch dummy; rm dummy
But everyone else on this planet doesn't care for directory timestamps. Why do you? :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With