15 Jan

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,

1
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,

1
touch -d 20130505 testfile

modify time stamp value of files

Copying time stamp from existing file to new file,

1
touch -r testfile newtestfile

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

1
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.

1
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 *

5 − two =