The find
command is used to search for files with specific modified dates. To find the one that was modified over 15,000 days ago, use:
find / -mtime +15000
CODE
The oldest file should be as of Jan 1, 1970. If anything older than that is found, it should be fixed. You can run the touch
command on them to change the latest access/modify dates. There are two ways to do it:
• Find the files on your own and run touch
on them manually:
OR
• Combine the two commands and use the find
command's exec
flag:
find / -mtime +$(( `date -u +%s` / 86400 - 1 )) -exec touch {} +
CODE
It will find all the files older than the Linux Epoch time, and then run touch
on them. The find
command replaces {}
with the files it finds, and the +
denotes the end of the exec
command.
Additionally, some files may have a timestamp set too far in the future. The format of the time_t
value used by tar is 32 bits, and it cannot encode the time after 03:14:07 UTC on January 19, 2038.
The following command will find and touch any files from the future:
find / -newermt "1 day" -exec touch {} +
CODE