Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-01-2004, 02:54 AM   #1
LQ Newbie
Registered: Sep 2001
Location: Mill Valley
Distribution: Redhat 9
Posts: 3

Rep: Reputation: 0
How do I undo last command executed?

I wasn't paying attention (late at night) and executed this command

chown user.user -R *

I ment to do it in a folder, but accidently ran it in / and before I knew it I was getting some permissoin errors.. opps... (it was stupid of me... I know..)

Im wondering can I run a command to back to revert all the permissions? Or undo my last command?

I tried searching first... To no avail..

Im running Redhat 9.0..


Last edited by Elfking; 02-01-2004 at 03:04 AM.
Old 02-01-2004, 03:57 AM   #2
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
well if you ran chown as root, i'd say you're pretty much hosed unless you got images of your linux install on cds/dvds. if you ran it as a regular user, then you don't really need to worry about it as even if the user owns a file, he can't change ownership of the file. my guess is that if you ran the chown command as a user, those are the permission errors you were getting.
Old 02-01-2004, 04:19 AM   #3
LQ Newbie
Registered: Aug 2003
Location: Beyond the third Van-Allen belt
Distribution: Slackware,Gentoo
Posts: 25

Rep: Reputation: 15
How long did you let it run before killing the command with ctrl+c? edit- I assume it was run by root.

To play it safe with recursively argumented commands I try to remember to use the verbose arg. with it so I can see what it it is doing and kill it quick if its wrong (there is a considerable performance hit while program lists its actions to con). But of course I don't and just rerun the command with -v to see what it actually did. ( !! -v ) And I assume the program will follow the same path of destructiveness as when run without verbose. So far I have assumed correctly noted the path it took and been able to repair the affected files, manually using more recursive commands when possible -ugh.

Last edited by Skitzo; 02-01-2004 at 04:22 AM.
Old 02-02-2004, 09:16 AM   #4
Registered: Jul 2003
Location: Florence, Ky
Distribution: CentOS 3.3-4, OpenBSD 3.3, Fedora Core 4, Ubuntu, Novell Open Enterprise Server
Posts: 213

Rep: Reputation: 30
From now on, look into Mondo. It has saved my ass more than once. You can do a 'rm -rf /' as root and have your system back up and running in an hour or so.

Old 02-05-2004, 01:18 AM   #5
LQ Newbie
Registered: Sep 2001
Location: Mill Valley
Distribution: Redhat 9
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for all the information... I let the command run until... well it spit back at me with some errors... It was too late.. I took it as a time to change from Red hat to SuSE, since well Red Hats only doing their enterprise version and well fedora which I don't think is ready for my home yet.

enigmasoldier: I will definately look into that backup tool Thanks for the link!

Until next time everyone...


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 On
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
To undo a given bash-command HULLU Linux - Newbie 6 02-21-2010 10:06 PM
removing only most previously executed command from history? jagroop mand Linux - Newbie 2 01-19-2005 05:39 AM
No effect when 'export' command executed in a script? sylvain_gnu Linux - Software 6 04-20-2004 07:15 PM
How find which command has been executed by which user. HPUX 11.11 OS kshell murugesan Linux - Distributions 3 04-16-2004 05:26 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:52 AM.

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