3

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?

3

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 Jun 25 '14 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.