0

Possible Duplicate:
Undo an “rm -rf ~” command?

So I made a stupid error, I did a sudo rm -rf of my ~/ directory. I wasn't thinking of the hidden files in there. Now instead of showing what directory I'm in, or my username it just says -bash-3.2$ where it used to say: [username@host location]$ What I am wondering is there a way to regenerate these files so that it shows folder location and my username, etc. Thanks.

5 Answers5

2

There is no way of recovering those files (unless you have done a backup - which you should do!).

Try copying the files .bashrc etc from another users account. If you do not have another users account, create one and login. Bash will recreate these files for you.

Ed Heal
  • 177
0

In your ~/.bash_profile file, add the line

export PS1='\u@\h \w $ '
0

rm -f ~/ would not have deleted your hidden files, but in your case only option is recovery of those files.

I am not sure whether it will help or not, but you can check Here

0

Restore from backup.

Failing that, the original files copied to the home directory of a new user usually reside in /etc/skel/.

Hennes
  • 65,804
  • 7
  • 115
  • 169
0

Copy the files from /etc/skel to your home directory. That will at least restore you to the dot files state of a new user. Including your .bashrc

ssmy
  • 1,435
  • 1
  • 10
  • 9