Manipulating file modification times in bulk

Kevin O'Gorman kogorman at
Wed Oct 2 09:26:45 UTC 2013

Dang!  I missed that in the man page.  Thanks.

On Sun, Sep 29, 2013 at 11:53 AM, Nils Kassube <kassube at> wrote:
> Kevin O'Gorman wrote:
>> I've got a bunch of SVG files created at various times; these are
>> shared with a bunch of folks via a web server.
>> Some browsers cannot view the raw SVG files, but can view them via an
>> HTML file, so what I actually present is a directory of the HTML
>> files.  These are created by a script and are very simple wrappers.
>> I would like the file modification times to be changed to the mtime of
>> the SVG file.  I can see some of the tools to do that, such as
>> touch(1) with --date.  It's not obvious to me how best to have a
>> script acquire the string representation of the dates.  Any
>> suggestions.
> How about this for an individual file?
> touch -r filename.svg filename.html
> Of course you could do it for all files at once with a short script like
> this:
> for f in *.svg;do
>   touch -r "$f" "${f%svg}html"
> done
> Nils
> --
> ubuntu-users mailing list
> ubuntu-users at
> Modify settings or unsubscribe at:

Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.
Please consider the environment before printing this email.

More information about the ubuntu-users mailing list