1827842 Members
1333 Online
109969 Solutions
New Discussion

Re: Undo in Unix

 
SOLVED
Go to solution
Muktha
Frequent Advisor

Undo in Unix

Hi all,

Is there any undo command in unix?Just undo the previous command.
Suppose I had removed 1 file.Can I retrieve it back?

Could you please advice me?

Regards
Muktha
6 REPLIES 6
Sajjad Sahir
Honored Contributor
Solution

Re: Undo in Unix



Dear Muktha

There is no "undo" function in UNIX. So if u are removing a file careful about it.

thanks and regards

Sajjad Sahir
Suraj K Sankari
Honored Contributor

Re: Undo in Unix

Hi Muktha,

There is nothing called "undo" in unix, if you deleted any file from your system,
to retrieve that file you need to restore from your previous backup media.

Suraj
Muktha
Frequent Advisor

Re: Undo in Unix

Thank you very much Sajjad , Suraj for your quick reply.
Thanks for sharing your knowledge
Muktha
Frequent Advisor

Re: Undo in Unix

Thank you very much.
I got it
Ganesan R
Honored Contributor

Re: Undo in Unix

Hi,

Unfortunately unix does not have "recycle bin" kind of things in it. Unix will do whatever you are asking to do.

It is always preferred to use interactive option(rm -i) for file removal.

Hope you are having backup to restore the file which is deleted by mistake.
Best wishes,

Ganesh.
Srimalik
Valued Contributor

Re: Undo in Unix

you can move the original rm(/bin/rm) to a different location your own version of rm copied to /bin/ which when called won't delete the file but move it to /.recyclebin/ (say).

You can have one more command called unrm which will restore a file from /.recyclebin to the original location.

You can also have an option(--please-consider-shift-pressed) for your rm command which will call the original rm and remove the file.

abandon all hope, ye who enter here..