Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I moved my home folder("huangzhiwu") to /usr/share carelessly. Then after i noticed that ,i make a new folder named huangzhiwu in /home ,and moved all files from /usr/share/huangzhiwu to the new home folder /home/huangzhiwu. but when i log in again, it failed,that means i cannot log in. What should i do? Thank you for help!

share|improve this question
I try to type command: chown -R huangzhiwu:huangzhiwu /home/huangzhiwu in safe mode as root, but still to fail to log in ubuntu. I fell so silly, why shuld i delete that! So really hope some one to help me – SunLnx Mar 3 '13 at 5:43

What happens exactly when you try to login?


ls -als /usr/share/huangzhiwu

are there any .files ?

move them also

sudo mv /usr/share/huangzhiwu/* /home/huangzhiwu/

then do:

cd /home/huangzhiwu

find -type d -exec sudo chmod 755 '{}' \;
find -type f -exec sudo chmod 766 '{}' \;
sudo rm .Xauthority
cd .. && sudo chmod 755 huangzhiwu

you may also try:

cd /tmp && sudo rm -r .X*
share|improve this answer
yeah, i login but iy return to the login windows quickly, i am to try your method, thank you,catalesia. and there are still all my files in /home/huangzhiwu, not missed – SunLnx Mar 3 '13 at 7:46
ehem, are there more users in the home folder? the find command I wrote will change all users privileges. best do cd /home/huangzhiwu I edited the answer – catalesia Mar 3 '13 at 7:56
Still fail. I find there are no unvisible files in my home folder. Only Doucments,Music,etc folders. Wuwu。。。 – SunLnx Mar 3 '13 at 8:16
what happens when you do ls -als /usr/share/huangzhiwu – catalesia Mar 3 '13 at 8:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.