LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-03-2012, 04:13 PM   #1
ssvirdi
Member
 
Registered: Apr 2009
Location: Ludhiana, Punjab, India.
Distribution: Ubuntu
Posts: 45

Rep: Reputation: 15
Question How to reverse an action (Is there any undo command) ?


Dear Friends,

I am a programmer and I always work on Terminal.
Doing work on commandline sometimes I give a wrong command.
eg $ cp -r html_files html_files_backup
By mistake I issue the above command.

Now Is there any way or command by which I can 'undo' the above command.

Please, help me, its a very important issue for me.

Thanks
Regards
Er. S.S.Virdi
 
Old 03-03-2012, 04:17 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
No undo for the pro :/ There is another possibility, some commands can ask you to confirm

The commands : cp, mv and rm have a -i option to ask question before execute the comand

If you like it, you can put aliases in your ~/.bashrc like :
Code:
alias cp="cp -i"
So each time you use cp command, cp -i is executed
 
Old 03-03-2012, 10:42 PM   #3
ssvirdi
Member
 
Registered: Apr 2009
Location: Ludhiana, Punjab, India.
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
Dear Cedrik,

Thanks for your answer. But I know about the confirmation option of these commands.

Dear my problem is different. I said about if this happen then what to do ?
 
Old 03-04-2012, 03:50 PM   #4
ssvirdi
Member
 
Registered: Apr 2009
Location: Ludhiana, Punjab, India.
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
My all Inteligent friends please solve my problem.

I know many experts are here.
 
Old 03-04-2012, 03:59 PM   #5
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,915

Rep: Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046Reputation: 1046
In Linux, the user creates his/her own "undo" function by implementing a good backup strategy. The root user has full power over the system, including the power to destroy it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do undo MV or RM command? pogromca Linux - Newbie 8 11-26-2013 06:25 AM
[SOLVED] How Do I undo This Command? Sumguy Linux - Newbie 4 08-25-2010 02:14 PM
Undo a mke2fs command. phoenixfire Linux - General 6 02-02-2010 05:40 AM
Undo a chmod command? WingnutOne Linux - General 3 06-23-2008 05:20 PM
How do I undo last command executed? Elfking Linux - General 4 02-05-2004 01:18 AM


All times are GMT -5. The time now is 03:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration