date - How can I modify the access timestamp of a file to seconds before using a shell command in unix? -
i try change access time of file seconds before, example set "1437082451" (07/16/2015 @ 9:34:11pm (utc)) "1437082450" (07/16/2015 @ 9:34:10pm (utc)) substract 1 second current access time. have shell commands, searched while can't find nothing.
touch -at $(date -d @$(( $(stat -c '%x' "$filename") - 1)) '+%y%m%d%h%m.%s') "$filename" that uses stat retrieve current access time of file, bash arithmetic subtract 1 second, , date format new time touch command.
Comments
Post a Comment