0

I accidentally used > to put an output inside ~/.bash_profile and ended up erasing a lot of configs I had saved there.

I need help to recover it. I still have iTerm opened with all the ~/.bash_profile old settings before erase active. Which means next time I close it or do source ~/.bash_profile all the settings will be lost forever.

Is there a way to recover the current ~/.bash_profile settings loaded? Or something?

fedorqui
  • 275,237
  • 103
  • 548
  • 598
Pedro Barros
  • 183
  • 1
  • 11

1 Answers1

3

Normally, .bashrc is a copy from /etc/skel, so you can restore it from there.

If you added some extra informations in this file, you still have them available in your current session. To recover those, say:

  • env to see those variables.
  • typeset -f to see the functions that are defined.
fedorqui
  • 275,237
  • 103
  • 548
  • 598
  • env solved by problem. As for /etc/skel , I don't have that in mac. Thanks – Pedro Barros Dec 17 '15 at 15:21
  • Nice to read that ; ) I [read](http://superuser.com/a/163555/204979) that the equivalent of `/etc/skel` in OSX might be `/System/Library/User\ Template/English.lproj`. Can you check so? – fedorqui Dec 17 '15 at 15:23