-   Linux - General (
-   -   How do I undo last command executed? (

Elfking 02-01-2004 02:54 AM

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..


megaspaz 02-01-2004 03:57 AM

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.

Skitzo 02-01-2004 04:19 AM

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.

enigmasoldier 02-02-2004 09:16 AM

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.


Elfking 02-05-2004 01:18 AM

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...

All times are GMT -5. The time now is 10:06 AM.