I need to batch edit file creation date (some stupid audio recorder set the file creation date to UNIX epoch and the correct recording date in the modification date) to set it to the files modification date.

I am aware of the touch command which can set a file creation like this touch -t 201406251546.10 filename.wav but I don't know how to retrieve each file modification date to give it as an argument to the touch command.

I also know that the ls -lT command prints the modification time before each file but on my system (OS X 10.9) the output is localized which is not really handy for batch processing

Any idea on how to do this?

1 Answer 1


I found a way around my particular problem thanks to this answer. It is MacOS only though.

SetFile -d "$(GetFileInfo -m filename.wav)" filename.wav
  • 2
    Since other flavors of Unix don't have file creation dates, it makes sense that the solution would be OSX-only.
    – Barmar
    Commented Jun 25, 2014 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .