Score:1

How can I maintain the original creation date or crtime of .txt files I create?

mx flag

I take a lot of notes in plain .txt files that I write in the default text editor and it is very useful for me. There is only one thing missing to make my "workflow" perfect. I would really like to know when the files were created. If I create one and in the future add something and save the date is overwritten.

I learned about the stat and debugfs command on this site... https://linuxhint.com/file-creation-time-linux/

Despite my .txt files being in an ext4 partition nothing comes up in the created field under the stat function.

When I use the debugfs function the crtime is the same as all the other times in other words it is the last time I saved it not when I created it.

In the process of writing this I did think of a manual way around which would be adding a date to every single one of my notes and edits which obviously is a bit more tedious... I would like to see if there is an "automated" way to see this.

Thanks a lot.

ch flag
What if you add creation date to your file name: `file_2023-04-17-14-43.txt` instead of `file.txt`. You will be able to parse such name in scripts to automatically obtain creation date.
MikeJ avatar
mx flag
Simple but very effective, I have not thought of that. I will highly consider that. Thank you
Score:0
cn flag
stat -c %W *.txt

will show the creation time in unix timestamp on EXT4. But it will depend on the mount options if this is overwritten afaik.

You are better off switching to xfs, Version 5 and upwards supports crtime too and shows Birth when using stat *.txt

I sit in a Tesla and translated this thread with Ai:

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.