Well, let’s reverse engineer what your mistake did:
find /root *.exe -exec mv {} /root/quarantine/ ;
Since most likely your /root directory has no .exe, this is passed unexpanded to find. So you asking find to look for all files under /root, and also the file '.exe’ (which does not exist), and then run the command “mv <filename> /root/quarantine/”.
As a result everything under /root gets moved to this one directory.
However there is some uncertainty since /root/quarantine is also part of the tree under /root, so I don’t know what happens to it and the files under it. Depends on whether the find sees the changes as it happens or will just refuse to move /root/quarantine to /root/quarantine/
Anyway the summary is that you have messed up everything under /root. Fortunately you may not have had much under it, except perhaps some dotfiles used by desktop environments, hence the loss of the desktop look. You should be thankful you did not specify / instead of /root.
Next time, do a dry run without the -exec to see what files are affected. If you had you would have seen that everything was included, not just .exe files.
yup, you guys are right…thanks God, i did not run / within that command. if this was happened! My God i could get very very big class becasue the server is most important one…actually the lesson is not to try any commands on Live server but make testing machine for such work.
I was wondering beside restoring “root” backup if recover could be possible. and also thanks to all for help
Well if you didn’t have any important files under /root, I suggest you move it out of the way, create a new /root, copy the contents of /etc/skel to it and then login and the desktop manager should create a new environment for you. But then logging in as root at the GUI, yuk, I shouldn’t even be suggesting that to you.
Are you serious, what if i delete the root directory…
dear this server is the core server and 1 minute downtime will arrenge a big class for me…
so please what you suggest/ help make sure no downtime.
There’s a difference between the root directory, which is /, and user “root”'s homedir which is /root. That’s where you did everything, in /root.
So no damage to the root directory of your server.
ONCE AGAIN: use su -c ‘yourcommandbetweensinglequotes’ instead of logging in as root !!!
If that server is such an important piece, you should have never executed any command as root with out understanding the consequences. If your intention was to move *.exe files to another directory, you should have just done it using simple commands.