so, I wanted to rename the user and its corresponding home folder following the instructions mentioned here How do I change my username?. However, what this made me is to rename the account, not the folder, and apparently I deleted all the contents of the home folder! Now I am also not able to log into the account through the ubuntu 11.04 desktop version and frankly I am a bit lost on how to solve this issue cause I do have a valuable data in the home folder.

ls -la of the folder:

dr-x------ 3 sheldon sheldon 4096 Mar  5 12:31 .
drwxr-xr-x 5 root    root    4096 Mar  5 12:04 ..
-rw------- 1 root    root    2013 Mar  4 17:44 .bash_history

Any ideas? How can I restore everything as it was and get my data back?

Thanks a milion!

  • What do you mean by "ls -la of the folder"? What folder? /home? If you deleted your user folder, the data is gone, unless you want to dive into data recovery but that might be a bit over your head if your Linux skills are only elementary. – pzkpfw Mar 5 '14 at 11:51

If all that you've done is rename the account, the home folder may still be there under /home/oldusername/.

To check this, open a terminal and enter sudo ls -al /home/oldusername/.

If you see your 'lost' files, enter sudo cp -r /home/oldusername/* /home/newusername/


You have to make a recovery for your deleted files. I advise you to use R-studio for Linux which is a free version of R-studio data recovery tools.

R-Studio for Linux recovers files:

  • Deleted from the computer and emptied from the Trash
  • Corrupted due to a virus, power failure or sudden shutdown
  • From disks that have been Re-formatted to the same file system or a different file system
  • Damaged and have bad sectors-R-Studio for Linux creates an image of the entire disk and recovers it from there to prevent further physical damage to the disk

You can download from here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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