Difference between revisions of "Atime"

From Hackepedia
Jump to navigationJump to search
 
Line 1: Line 1:
 
Time of last access of a file, the information is taken from the [[inode]], only if the [[filesystem]] doesn't have the noatime option.
 
Time of last access of a file, the information is taken from the [[inode]], only if the [[filesystem]] doesn't have the noatime option.
  
  $ stat -s [[variables|$file_or_diskname]] | tr ' ' '\n' | grep atime
+
  $ stat -s [[variables|$file]] | tr ' ' '\n' | grep atime
 
  st_atime=1130490958
 
  st_atime=1130490958
 
  $ date -r 1130490958
 
  $ date -r 1130490958
 
  Fri Oct 28 11:15:58 CEST 2005
 
  Fri Oct 28 11:15:58 CEST 2005
  $ ls -luT disk
+
  $ ls -luT [[variables|$file]]
  -rw-r--r--  1 root  wheel  33554432 Oct 28 11:15:58 2005 disk
+
  -rw-r--r--  1 root  wheel  33554432 Oct 28 11:15:58 2005 file
  
 
It can be helpful reading the atime of a script to see when it was last run.  Perhaps an rc script to see when a service was started/stoppped/restarted.
 
It can be helpful reading the atime of a script to see when it was last run.  Perhaps an rc script to see when a service was started/stoppped/restarted.

Latest revision as of 13:58, 28 October 2005

Time of last access of a file, the information is taken from the inode, only if the filesystem doesn't have the noatime option.

$ stat -s $file | tr ' ' '\n' | grep atime
st_atime=1130490958
$ date -r 1130490958
Fri Oct 28 11:15:58 CEST 2005
$ ls -luT $file
-rw-r--r--  1 root  wheel  33554432 Oct 28 11:15:58 2005 file

It can be helpful reading the atime of a script to see when it was last run. Perhaps an rc script to see when a service was started/stoppped/restarted.