Javatpoint Logo
Javatpoint Logo

Linux touch -r option

This command will update time with reference to the other mentioned command. There are two ways to use this command. Both works the same.

In below example, we want to change time-stamp of 'Demo.txt' with reference to 'demo.txt'. Firstyou can write it as,


First we'll see the status of both the files before using touch comand.

TOUCH Command

Now after using touch -r demo.txt Demo.txt command, time of Demo.txt has been changed wit reference to time of demo.txt

TOUCH Command
Next TopicLinux Touch t

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA