I checked manual of find , and there's an option -ctime which specify the last modification time of inode.

But on what occasion would inode change ? When is that option useful ?

  • 2
    The inode can change but what you mean is the file status information associated with a certain inode. I don't answer since I didn't double check, but it would change when you change your rights, access time, owner, data, etc. This option is useful if you want to check what changed recently on your filesystem, for security reasons (but it's not reliable of course) or just because you forgot what file you just modified. It's just a tool that gives your control, options are here because a file/inode has properties, it's up to anyone to find a use, just know it's here, eventually it'll be useful. – Aki Feb 9 '12 at 9:20

To simplify:

  • Any change in file contents changes both the mtime and the ctime.
  • Any change in metadatas (permissions and other information shown by stat) changes only ctime.

When is it useful: I don't know… But for example, if you want an over-approximation for the time when the last link (ln) to the inode was created, you should check ctime not mtime.

  • 2
    An important use of the ctime is for incremental backups: anything you might want to back up (data or metadata) affects the ctime, so if the ctime is older than the last backup, you don't need to back up again. – Gilles 'SO- stop being evil' Feb 10 '12 at 1:36
  • I found that using flock changes the mtime and ctime! – CMCDragonkai Aug 16 '15 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.