changing file times
Larry Wall
lwall at jpl-devvax.JPL.NASA.GOV
Wed Oct 31 05:55:37 AEST 1990
In article <28928 at boulder.Colorado.EDU> englund at tramp.Colorado.EDU (ENGLUND TODD CHARLES) writes:
:
: Does anyone know how to change the last date a file was altered? Even
: if one doesn't happen to be a super-user?
perl -e '$DAYS = 24*60*60; utime(time, time - 30 * $DAYS, @ARGV)' file1 file2...
will change the mod time of all listed files to 30 days ago. (And changes
the last access to the current time.)
You do, of course, have to be the owner of the files or superuser.
Larry Wall
lwall at jpl-devvax.jpl.nasa.gov
More information about the Comp.unix.questions
mailing list