Is it possible to change a file "Birth date" (according to the stat file "Birth" field)?

I can change the modification/access time with touch -t 200109110846 file, but can't find the corresponding option for "Birth".

  • Which filesystem? There might be some fs-specific tool – muru Dec 7 '19 at 9:55
  • @muru ext4..... – stas Dec 7 '19 at 9:57
  • Birth date isn't accessible from userland. – roaima Dec 7 '19 at 9:58
  • @roaima why so? – stas Dec 7 '19 at 10:02
  • Correction: statx() from kernel 4.11 onwards does expose btime. – roaima Dec 9 '19 at 7:38

Like the last change time, the birth time isn’t externally controllable. On file systems which support it, the birth timestamp is set when a file is created, and never changes after that.

If you want to control it, you need to change the system’s notion of the current date and time, and create a new file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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