0

I saw the post on how to change time and date using touch or setfile. Is there a way to remove time and date entirely from a file? I tried xattr -c which did not work.

  • Which date time information ? creation, modification, access ? – ankii Dec 8 '19 at 12:34
  • @ankii, It doesn't matter as it cannot be removed, only changed. – user3439894 Dec 8 '19 at 12:38
1

No, that is not possible. The creation/modification date/time is a fixed field within the file system, and not a user-specified attribute that you can remove.

  • Correct, +1. I seem to recall that this could be done on earlier versions of the file system using touch -t YYYYMMDDHHMM /Some/File/In/Filesystem. Do you know when that was changed? – Seamus Dec 8 '19 at 17:35
  • I cannot remember any time where it was possible to remove the time stamps entirely - that must have been before 1985 if so. You can zero out the timestamp, but it's still a timestamp corresponding to 1904 then. – jksoegaard Dec 8 '19 at 21:51
  • @Seamus, Changing a files date/time stamp with touch is not the same as removing it. The OP explicitly says "remove" not change. – user3439894 Dec 9 '19 at 5:48
  • @user3439894: Yes, you're correct. But on the chance that the OP's objectives might be satisfied by substituting a "default" date/time in the field, I felt it might be useful to make that known. – Seamus Dec 9 '19 at 13:14
  • @Seamus, The OP states they are already aware of how t change it, "I saw the post on how to change time and date using touch or setfile." and then asks "Is there a way to remove time and date entirely from a file?", so it is quite clear the objective is to remove it not change it. – user3439894 Dec 9 '19 at 13:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .