What is the modification date ls reports for directories?
Note that, in Unix, a directory does not "contain" the files in it. Rather, it contains links to them. See the link(2)
system call for further information.
This means that the "direct" contents of a directory is a list of filenames and corresponding i-numbers. The modification date of the directory, therefore, indicates whenever this list changed. Operations that would cause such changes would include, but not necessarily be limited to, the following:
- Creating a new file in the directory
- Removing (or, rather,
unlink(2)
ing) a file from the directory - Renaming a file in the directory
- Hard-linking a file elsewhere into the directory
Think of directory as of simple file containing list of other files. Whenever you change its contents (rename files, add or remove contained files) the modification time of a directory changes.