I found the
.bashrc file and I want to know the purpose/function of it. Also how and when is it used?
You put commands here to set up the shell for use in your particular environment, or to customize things to your preferences. A common thing to put in
and then hit Ctrl-D three times,
As a counterexample to aliases, which I prefer to put in
If you put that in
You get a new interactive Bash shell whenever you shell out of
The purpose of a
It works by being run each time you open up a new terminal, window or pane.
You can see mine here:
-1. Set up my history file to ignore duplicates and be much larger than the default.
I've made this portable so that it works on any of my linux or OSX machines without customization - hence a number of tests for presence are done before using certain functions and other scripts. This also makes it easier to use the entire file immediately on a new machine without having issues that affect opening a new terminal window.