Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had deleted an important file once and later i had changed the permissions of a file which i am not able to revert now. Is there any way through which i can undo delete or revert permissions on files while working with terminal?

And one more question about Ubuntu ... Why do we never get a dialog box asking 'are you sure you want to delete' as compared to windows.I see it as a flaw in Ubuntu GUI. Once you press delete,there it is in the trash but never prompts to ask if we really want it to be deleted and ofcourse, I know ppl would be like -- why you want reassurance before is a part of HCI and should be implemented(I am sorry,just a beginner).

share|improve this question
As far as I know nautilus will prompt for confirmation when you empty the trash/rubbish bin but not when you 'delete' a file. If you use a terminal then rm -i will ask for confirmation.… – 23 93 26 35 19 57 3 89 Apr 25 '12 at 10:33
@forestpiskie Ya i know abt the terminal thingy btw i am using 10.10 Lucid not nautilus. – bebojoor Apr 25 '12 at 10:35
@forestpiskie And if i use rm -i , It is like asking the terminal to prompt me ... which is not a good interface. It should prompt for all automatically. – bebojoor Apr 25 '12 at 10:44
If you want delete prompts in the command line add this alias to your .bashrc… – RobotHumans Apr 25 '12 at 12:02
up vote 3 down vote accepted

If deleted the file in a terminal with rm then it will not go to the trash, do it in filemanager and it will.

You 'might' be able to restore the file, but all the time you're using the system the area the file was in could be overwritten.

You should be able to revert permissions on files.

share|improve this answer
I donot know what were the earlier permissions set. I want to rollback not change again. and Data recovery... is it that tedious to retrieve a deleted file ? Can you suggest some alternatives? – bebojoor Apr 25 '12 at 9:04
It would I think be rather tedious, if it's that important though it would be worth it. You don't need to know what the permissions were - you do need to know what you want them to be now. – 23 93 26 35 19 57 3 89 Apr 25 '12 at 9:07

check this ... migh be helpful

suppose you did

rm very_important_file

from the terminal. recovering this file is a tedious and not always successful process

instead if you used the script mentioned up. you don't have to worry about this because

rm very_important_file
mv very_important_file ~/.Trash/

are equivalent. the script handles more cases and doesn't alter your system rm at all and that is because it's put into the user local bin folder so it shadows the system rm and yet doesn't affect it or disable using it

this is a refined aliasing approach but without losing any feature

share|improve this answer

I think it may be in the trash.You may get to recover the important file from the trash. otherwise I think you should download or make the file again.

share|improve this answer
@bebojoor ofcourse the first thing i did was to look for it in the trash but its not found and about downloading and making the file... thats what i will obviously be doing in the end if i am not getting any solution. :( – bebojoor Apr 25 '12 at 8:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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