Skip to content
Advertisement

Tag: string-formatting

Preserve timestamp when editing file

I want to preserve the timestamp of the files I’m editing in a for loop The issue is I need to get a formatted date string from the file so that I can do touch -r to revert the files date back once the loop has completed. stat is not giving the me the format I need. Required Format: YYMMDDhhmm

Advertisement