ctime

Ctime From Hackepedia

Time of last change of the inode (e.g. permissions, ownership, etc). This time is taken from the inode itself. The ctime does not indicate the "creation time" of the file. Under some circumstances--specifically if the permissions and ownership in unchanged since the file was created--it may have the same value as the "creation time," but this is conincidence, and should not be relied upon.

$ stat -s $file | tr ' ' '\n' | grep ctime
st_ctime=1130490970
$ date -r 1130490970
Fri Oct 28 11:16:10 CEST 2005
$ ls -lcT $file
-rw-r--r-- 1 root wheel 33554432 Oct 28 11:16:10 2005 file
Usually when the mtime of a file is updated, the ctime will be updated as well. For example, when the size of a file is changed, this must be reflected in the metadata stored in the inode; thus, the ctime is updated appropriately.

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

$ find /path -ctime -2 -print | wc -l
     38

$ find /path -ctime -2 -print | wc -l
     38


German - von Hackepedia

Die Zeit die zuletzt änderungen an der inode sah (zb. Zugangsrechte, Benutzer änderungen). Diese Zeit wird direkt von der inode gelesen. Die ctime indiziert nicht die "creation time" also das erstellungs Datum der Datei. Es kann "aussehen" das es das Erstellungs Datum ist, wenn diese Datei gerade neu beschrieben wurde.

$ stat -s $file | tr ' ' '\n' | grep ctime
st_ctime=1130490970
$ date -r 1130490970
Fri Oct 28 11:16:10 CEST 2005
$ ls -lcT $file
-rw-r--r-- 1 root wheel 33554432 Oct 28 11:16:10 2005 file
Meistens wird die mtime von einer Datei auch geändert, wenn die ctime sich ändert. Zum beispiel, wenn die grösse von einer Datei sich ändert dann müssen diese Meta-Daten auch in der inode geändert werden, deswegen ändert sich die ctime auch.

Die ctime kann mann gut benutzen um zu sehen ob sich eine Datei in den letzten paar Tagen geändert hat oder ob eine neue Datei geschrieben wurde. (2 tage in diesem Beispiel):

$ find /path -ctime -2 -print | wc -l
     38

$ find /path -ctime -2 -print | wc -l
     38

DeutschEnglish
Dateisystemfilesystem
Dateifile