The officially official Devuan Forum!

You are not logged in.

#1 2021-06-06 16:54:27

starbreaker
Member
From: United States
Registered: 2021-06-03
Posts: 16  
Website

[HOWTO] Backdating Files with the Touch Command

If you ever needed to backdate file, you can do it using the touch command with the -t flag and the --time=mtime option.

Here's an example.

$ touch -t 200101012358 --time=mtime foo.txt

This will create/update "foo.txt" in the current directory and set its modification time to 11:58PM on January 1st, 2001.

This might come in handy if you ever want to generate a RSS/Atom feed for a static website using a shell script. Read man touch for further details.

Last edited by starbreaker (2021-06-06 16:56:23)


"Out of order? [BLEEP!] Even in the future nothing works."
desktop: refurbished ThinkCentre M92p (i7, 32GB RAM, 1TB SSD, 2TB HDD)
laptop: refurbished Thinkpad T60 (Core 2 Duo, 3GB RAM, 1TB SSD)
gemini capsule: starbreaker.org

Offline

Board footer