My Board
Set Timestamp Using a Reference File with Linux Touch Command - Printable Version

+- My Board (https://ellohost.com/forum)
+-- Forum: Tutoriel EN (https://ellohost.com/forum/forumdisplay.php?fid=8)
+--- Forum: Others (https://ellohost.com/forum/forumdisplay.php?fid=20)
+--- Thread: Set Timestamp Using a Reference File with Linux Touch Command (/showthread.php?tid=753)



Set Timestamp Using a Reference File with Linux Touch Command - aaron - 09-08-2023



    Set Timestamp Using a Reference File with Linux Touch Command

   

The Linux touch command can also set a file’s access and modification time by reading the timestamp information from another file. For example, the following touch command with the -r option will scan the timestamp information from reference.txt and set these timestamp values to file_name.txt. Here’s an example of the command:

   
touch -r reference.txt file_name.txt