Difference between revisions of "Ctime"

From Hackepedia
Jump to navigationJump to search
 
Line 1: Line 1:
 
Time of last change of the [[inode]].  This time is taken from the [[inode]] itself.
 
Time of last change of the [[inode]].  This time is taken from the [[inode]] itself.
  
  $ stat -s disk | tr ' ' '\n' | grep ctime
+
  $ stat -s [[variables|$file_or_diskname]] | tr ' ' '\n' | grep ctime
 
  st_ctime=1130490970
 
  st_ctime=1130490970
 
  $ date -r 1130490970
 
  $ date -r 1130490970

Revision as of 12:43, 28 October 2005

Time of last change of the inode. This time is taken from the inode itself.

$ stat -s $file_or_diskname | tr ' ' '\n' | grep ctime
st_ctime=1130490970
$ date -r 1130490970
Fri Oct 28 11:16:10 CEST 2005
$ ls -lcT disk
-rw-r--r--  1 root  wheel  33554432 Oct 28 11:16:10 2005 disk

Usually when the mtime gets updated the ctime will be updated as well for example when the file size changes this has to be reflected in the inode.

The ctime is also a good place to check for new files written or updated in your system in the last few days (2 in this example)

$ find . -ctime -2 -print | wc -l
     38