I have large number of files and folders in a separate partition and I need them to be ordered by creation/modification time (in Nautilus I click on the "View items as list" button and on "Modified" colum to get this done). Few days ago I saw a sub-folder, that was not needed, in one of them and I deleted it. But that also changed the modification date of folder that contained it. Now this folder is at the top of the list.

It is not a big deal, but it got me wondering if there is a way to revert to previous modification date.

I am using Ubuntu 14.04.


I don't know about reverting to the previous modification date, but you can certainly set it to an arbitrary date: touch -t or touch -d. Check man touch for the format to use, and choose between -t or -d.

For example, to set the last modification time on a directory called Downloads to 5th December 2016 at 12:30 you'd use:

touch -t 201612051230 Downloads
  • Works nice. Thank you. I know touch command but I didn't know about this option. For some reason I thought it will be more difficult. I will wait a bit if someone knows how to get previous modification date, otherwise I will mark your answer as Accepted. – NonStandardModel Dec 7 '16 at 20:18

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.