Directory last modified date

LinuxUnixFtp

Linux Problem Overview


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?

Linux Solutions


Solution 1 - Linux

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. Additionally, adding, removing or renaming files/directories in subdirectories does not propagate up to the directory. If you change the permissions on the directory, the ctime changes but the mtime does not.

Solution 2 - Linux

A directory is like a file that contains a list of the filenames in it (indeed, you may have accidentally opened a directory in an editor, where you can see it is a mostly-readable list of its contents) -- so it is modified when a file in that directory is added, removed, or renamed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlec SmartView Question on Stackoverflow
Solution 1 - LinuxJonathan LefflerView Answer on Stackoverflow
Solution 2 - LinuxEtherView Answer on Stackoverflow