Directory last modified date

Alec Smart picture Alec Smart · Sep 1, 2010 · Viewed 40.5k times · Source

Am wondering when the directory last modified date is changed. I modified a file inside a particular directory (via FTP), but the directory's LMD did not change. How is it suppose to function?

Answer

Jonathan Leffler picture Jonathan Leffler · Sep 1, 2010

The mtime (modification time) on the directory itself changes when a file or a subdirectory is added, removed or renamed.

Modifying the contents of a file within the directory does not change the directory itself, nor does updating the modified times of a file or a subdirectory. If you change the permissions on the directory, the ctime changes but the mtime does not.