Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I did something exceedingly stupid and now my .bashrc file is gone. Is there any way for me to recover it? I still have a terminal window open that uses the old bashrc file. If there's no way for me to recover it all (as I imagine there isn't) what else should I copy to a new .bashrc besides the old $PATH? I'm on Ubuntu 12.04 if there is an OS-specific solution.

share|improve this question

migrated from stackoverflow.com Aug 7 '13 at 20:20

This question came from our site for professional and enthusiast programmers.

1  
set can tell you a bit more than sole $PATH. –  choroba Aug 7 '13 at 15:09
1  
You're probably better off asking on Unix & Linux. There's a related question there –  user2062950 Aug 7 '13 at 15:10
2  
the best you can do (I think) is capture the state of your open window session. export > export_list.txt; set > set_list.txt; functions > func_list.txt; alias > alias_list.txt might get you most of what was there. Any logic will have to be rebuilt. Good luck. –  shellter Aug 7 '13 at 15:11
add comment

1 Answer 1

Ubuntu uses /etc/skel/.bashrc as the base .bashrc that gets copied into every new users home directory. Unless you have made custom changes you can simply copy /etc/skel/.bashrc to your home directory and you will be set. If you have made custom changes then you will need to make them again.

share|improve this answer
add comment

Your Answer

 
discard

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.