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

5 (100%) 1 vote

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”]

For any query or issue, feel free to discuss on http://discuss.eduguru.in

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

%d bloggers like this: