How do I determine, when a file was last opened?
I've looked at
man ls (using GNU coreutils 8.22) and I don't see anything about this timestamp.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You may want to check this:
ls -l --time=atime atime — updated when file is read mtime — updated when the file changes. ctime — updated when the file or owner or permissions changes.
Have fun! :)
If you want sorted result by access time:
-u with -lt: sort by, and show, access time with -l: show access time and sort by name otherwise: sort by access time
If you want to get full date time, use
$ ls -ltu --full-time
$ stat -c "%x" -- test.txt 2014-06-30 19:21:05.481161360 +0700
You need to use GNU
stat command. Example:
stat my_file.txt will give you what you are looking for.