How to change the attributes of a file in linux

>> Tuesday, 12 February 2019



I often want to change the timestamp of files when testing scripts so I can see whether the logic works with different ages of files etc.

use touch:


touch -a -m -t 201512180130.09 myfile


-a  change the access time
-m change the modification time
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time


0 comments:


  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP