6

This is only an issue because some antique software has Y2K issues, I need to move the file creation dates from 1990's to 2000 but for files across 21 subdirectories. A way to manage it recursively is what I'm looking for.

This ends up as an NFS share back to an MSDOS client and it appears to be using the creation date. Not the modified date, as I've tried the touch mod already with no success.

A.Adverse
  • 195

1 Answers1

14

You can change the modification times of all files and directories under your target directory with:

find /target/dir -exec touch -m {} +

That will set the modification time to today. You can also set it to a specific date of your choosing:

find /target/dir -exec touch -m -d '1/1/2000' {} +

I really doubt you'd need to touch the creation date since they're not really used in Linux (see [1],[2],[3]) kernel doesn't even provide a way of accessing it easily.

terdon
  • 100,812
  • I'll give you the vote, it does do what I asked for, although it didn't immediately solve my problem. Should've thought of it first, I ended up having to modify the date via md-dos – A.Adverse Oct 13 '18 at 12:53
  • @A.Adverse what's missing? And what did you modify, was it the creation date? What's "md-dos"? Just a typo for ms-dos or something else? – terdon Oct 13 '18 at 12:56
  • Ahh yes md-dos was a typo for ms-dos. Yes according to MS-DOS its the creation date, who knows what it changed according to linux. I seem to be developing typing dyslexia in my old age. – A.Adverse Oct 13 '18 at 22:51