Score:0

Which file operations trigger directory modification time and date to change?

yt flag

I have a directory named IT-documentation. Using ls -l in the terminal at its parent directory level yields (among numerous other lines)

drwxr-xr-x 16 robin robin 4096 Oct 31 08:02 IT-documentation

Now I say cd IT-documentation, then repeat ls -l. Among the numerous other lines this yields is

drwxr-xr-x  2 robin robin 4096 Nov  1 10:00 'How Tos'

On November 1 a file was in fact added to the subdirectory How Tos. So evidently changing something within a directory is not considered as modifying it. Or do I have a bug in my system (or a bee in my bonnet)?

us flag
Is `How Tos` a directory inside `IT-documentation`? Right now, what you are asking is very unclear. Please [edit](https://askubuntu.com/posts/1372862/edit) to clarify your question (otherwise, the moderators might close the question).
Score:1
in flag

Modifying a directory means adding, removing, or renaming something in the directory, or renaming or touching or changing the permissions on the directory itself.

Modifying or changing permissions on things in the directory do not modify the parent directory.

Artur Meinild avatar
vn flag
May I suggest the second line as: "Modifying or changing permissions or timestamps ..."?
Score:0
vn flag

As I understand, adding files only work for modification times in the current directory. So if you added a file in IT-documentation, the modification date of this directory would change.

However, if you add a file in a subdirectory (How Tos), this doesn't change IT-documentation, as no files are added here. Changing existing files and directories also does not trigger modification date changes, only adding, removing or renaming files will. I believe this is just how it works.

Please also see this answer.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.