Changing a file’s Date Created and Last Modified attributes in linux

Easiest way – accessed modified will be the same:

# touch -a -m -t 201512180130.09 fileName.txt

Where:

-a = accessed
-m = modified
-t = timestamp – use [[CC]YY]MMDDhhmm[.ss] time format

If you wish to use NOW just drop the t and the timestamp

  • You can add *.txt file to change the attributes of all the txt file.

For example:

# touch -a -m -t 201512180130.09 *.txt

  • To verify they are all the same: stat fileName.ext

 

[xyz-ihs snippet=”Discuss”]

Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

Leave a Reply