Results 1 to 4 of 4
I am new to linux.
My question is that suppose i wrote a command in the terminal and the action has taken place like copying or renaming a file using ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-05-2010 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 1
Undo the effect of a command in terminal
I am new to linux.
My question is that suppose i wrote a command in the terminal and the action has taken place like copying or renaming a file using cp, mv command.
But, like the windows is there is any command so that the previous action can be undone.
- 01-05-2010 #2
No, there is no general way to undo a command. So long as you're not working as root, you can't cause too much damage, though of course you can delete your own stuff quite easily and there is no easy way to recover a file once deleted from the command line.
"UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things." – Doug Gwyn
- 01-05-2010 #3Just Joined!
- Join Date
- Dec 2009
- Location
- Omaha, NE
- Posts
- 1
- 01-07-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,142
This is why we keep backups...
Really though, once you have initiated a command, you might be able to kill it (Ctrl-C) before it completes and makes your system a toaster, but systems are so fast that unless the operation you started is a long-running one, you are probably SOL. We all do this, and then whack our heads like Home Simpson - Doh! Personally, my favorite (which I have done more than once in the past) is to execute the command "rm *", forgetting that I was logged in as root and was in the root directory /. Oops... Now where did I put that last system image backup?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote

