Step to modify time stamp value of files in linux

Modify time stamp value of files in linux

We can modify time stamp value of files using the touch command. It can be changed based on Access Time, Modify Time or combination of both. To check the time stamp value of a file, please execute,

stat testfile

modify time stamp value of filesPlease use the below commands to create a file with an older time stamp, say May 05 2013,

touch -d 20130505 testfile

modify time stamp value of files

Copying time stamp from existing file to new file,

touch -r testfile newtestfile

Copying time stamp from existing file to multiple new files \ existing files

touch -r testfile newtestfile  newtestfile2 newtestfile3

modify time stamp value of files

Make changes to Access Time and Modify Time

To modify the Access Time parameter of a file, please use the switch “-a“.  It will change access time to the current date and time as given below.

touch –a testfile

To make changes to  “Modify Time” parameter of a file, please use the switch “-m“.  It will change modify time to the current date and time as given below.

modify time stamp value of files

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.