Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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 Aug 7 '13 at 20:20

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

set can tell you a bit more than sole $PATH. – choroba Aug 7 '13 at 15:09
You're probably better off asking on Unix & Linux. There's a related question there – user2062950 Aug 7 '13 at 15:10
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

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

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.