[SOLVED] Ran rm -rf on Home Directory unable to run commands as Root
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ran rm -rf on Home Directory unable to run commands as Root
Accidently ran rm -rf while the pwd was /home/user-name
Now I'm unable to run any command whatsoever as root, ls,vi,cnf whatever, they don't work.
However the commands work as normal user.
I can guess that the files with root ownership in the home folder were deleted but I would like to revert everything back to normal and would like to know how to solve this problem.
well the two things don't make any sense as directly related issues, deleting a norml users home directory can not affect root, unless your system is already horrendously ill. You also havne't said anything about how they don't work... error messages etc. The only thing I can directly think of is your PATH statement somehow not existing, which still doesn't match your actions in the slightest.
well the two things don't make any sense as directly related issues, deleting a norml users home directory can not affect root, unless your system is already horrendously ill. You also havne't said anything about how they don't work... error messages etc. The only thing I can directly think of is your PATH statement somehow not existing, which still doesn't match your actions in the slightest.
Thanks for Replying.
Let me try to vividly explain what I did.
I was logged into directory : /home/user
I switched to root, typed this:
Code:
linux:/home/user# rm -rf foldername
It seems that the foldername i typed was non existent, the actual name of it was /foldername (Which Still exists btw)
Now,
Here's what I get after I run commands (As Root):
for e.g :
Code:
linux:/home/user#ls
If 'ls' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf ls
The above applies for all the commands, I run as root now. Ran env, it returns the same message stated above.
That's the usual message that pops up whenever something's not installed, right?
However when I run commands as normal user, they work.
And Yes, I was messing with the path statement, editing the /etc/skel/.bashrc, /home/user/.bashrc, /etc/bash.bashrc. I was just setting new paths for installing a compiler(added line :export PATH:$PATH:$DIRBIN). Nothing else. Now, I undid the changes. The problem persists.
What might be the solution?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.