Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My computer reset itself to 2001 and messed up my iPhone as well.

I have reset the date but now all the files on the HDD are dated 2001.

How do I change this?

share|improve this question
1  
Something isn't quite right here. Computers run the current date all the time, and all the files on the HDD don't simply get updated to the current time. You could use the find command to list all files with dates older than X and then execute touch -r to set the times in relation to another file. Is this what you seek? –  bmike Sep 8 '11 at 11:29
    
@bmike : this is an answer, not a comment. The right answer moreover ;-) –  Pierre Sep 8 '11 at 13:02

1 Answer 1

Something isn't quite right here. Computers run the current date all the time, and all the files on the HDD don't simply get updated to the current time. You could use the find command to list all files with dates older than X and then execute touch -r to set the times in relation to another file if that's easier than specifying a time directly via the touch command.

I don't know what process is changing the dates, but something like this should work...

find /Volumes/whatever -type f -mtime whenever -print0 | xargs -0 touch -r /path/to/ref.file

Use care since on macs, files with spaces or other characters that the unix shell interprets as ending one file. The -print0 and xargs -0 agree to use the null character as the delimiter to avoid creating all sorts of a mess of your system. Do have a good backup if you are not an expert at using touch and the command line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.