Search code examples
linuxbashshellrecover

How to show the source of the current .bashrc file?


So I've just echo into bashrc, and removed everything there. But my shell wasn't closed or reloaded, so the source of my bash is old. Is there a way to see the source of my current bashrc file?


Solution

  • No, basically. Bash evaluates the contents of your login scripts, but doesn't keep them around. You may be able to reconstruct parts of them by looking at your current environment (with the env command), but most of it is gone. Bash doesn't offer advanced reflection.

    Consider this a learning experience and let it motivate you to make back-ups and keep important configuration in version control from now on.