5

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 ?

1
  • 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. Commented Feb 9, 2012 at 9:20

1 Answer 1

6

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
  • 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. Commented Feb 10, 2012 at 1:36
  • I found that using flock changes the mtime and ctime! Commented Aug 16, 2015 at 13:08

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.