UNIX - Shell get last access file -
how can timestamp on file ( last access )
tried this:
stat -c %x filename <br />
but doesn't work
stat -c %x filename
correct gnu stat. if you're on non-gnu platform (such macos), no format-string functionality may available; in case, might consider using different tool. (for instance, if have gnu find
, -printf
can used print atime).
find filename -printf '%a@'
...is gnu find
equivalent (if install on os x using macports, may called gfind
). if don't have either, i'd suggest perl
if want portable alternative.
note, way, it's common mount filesystems noatime
improved performance (reduced overhead updating metadata); thus, may access time unavailable.
Comments
Post a Comment