Re: Last time file accessed/used/executed, but not modified

From: Dances With Crows (danSPANceswitTRAPhcrows_at_gmail.com)
Date: 08/24/05


Date: Wed, 24 Aug 2005 11:51:37 -0500


["Followup-To:" header set to comp.os.linux.misc.]
On Wed, 24 Aug 2005 08:06:23 -0700, David Smith staggered into the Black
Sun and said:
> Is there any utility that will tell me the last time a file was
> accessed

/bin/stat -c '%x' filename

Also try %X. Note that this information will be useless if your
filesystem was mounted with noatime. atime info is usually not very
useful, so lots of people mount their filesystems with noatime for a
slight performance improvement.

> or used/executed (not necessarily modified)

? Only 3 times are stored, atime, ctime, and mtime. atime is the last
access time. ctime is the last time the file had a status change, like
if it was chmodded or chattred. mtime is the last time the file was
modified.

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /    "He is a rhythmic movement of the
-----------------------------/      penguins, is Tux." --MegaHAL


Relevant Pages

  • Re: [PATCH] O_NOATIME support
    ... >> backing a file up does not count as reading it. ... I don't see why preserving the mtime and ctime would be necessary, ... save the atime and mtime while doing it). ...
    (Linux-Kernel)
  • Re: File modification and opening dates
    ... The unix time stamps are mtime, atime, ctime. ... "created" timestamp on traditional unix. ...
    (comp.sys.mac.apps)
  • Re: [PATCH] O_NOATIME support
    ... >> Any chance we could change the flag to also not update mtime and ctime ... > I don't see why preserving the mtime and ctime would be necessary, ... > save the atime and mtime while doing it). ...
    (Linux-Kernel)
  • Problem with STAT under Windows
    ... But all variable just get blank, (i got filename). ... print "atime $atime \n"; ... print "mtime $mtime \n"; ... print "ctime $ctime \n"; ...
    (perl.beginners)
  • Re: Last time file accessed/used/executed, but not modified
    ... filesystem was mounted with noatime. ... Only 3 times are stored, atime, ctime, and mtime. ...
    (comp.os.linux.misc)