Created
April 15, 2021 17:28
-
-
Save pas-calc/c58df75a8482cfc564ea5197c7f97121 to your computer and use it in GitHub Desktop.
append last changed date to end of file without changing timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f="filename.ext"; echo "file='$f'"; d=$(stat -c %y "$f" | cut -c-19); echo "modified=$d"; echo -en "\n$d" >> "$f"; touch -d "$d" "$f"; ls -al "$f" | |
Do 15 Apr 2021 19:26:30 CEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment