master
Raw Download raw file

date: “2017-01-12” draft: false title: “MAC times”


How common commands change MAC times for a directory (foo):

Action Example Command atime ctime mtime
creation mkdir foo
directory move mv foo bar
file creation touch foo/foo
list directory ls foo
change directory cd foo
file test -f foo
file move/rename mv foo foo_mvd
permissions change chmod/chown <some_perm> foo
file copy mv foo_mvd foo
file edit vim foo
file edit emacs foo
file edit vi/nano foo

Source

How common commands change MAC times for a file (bar)

Action Example Command atime ctime mtime
creation touch bar
rename mv bar bar
permissions change chmod <some_perm> bar
copy cp bar baz
copy overwrite cp bar baz
append cat >> bar
overwrite cat > bar
truncate cp /dev/null bar
list file ls bar
edit vim/emacs/xemacs/joe/jed bar
edit ed/nvi/vi/nano/pico bar ✔1 ✔1 ✔1

1 - all times changed, but atime is slightly older than mtime and ctime.
Source

See also

  • [ls]({{< relref “unix/commands/ls.md” >}})
  • [stat]({{< relref “unix/commands/stat.md” >}})