This section describes the setup files - .bashrc, .bash_profile, - for the bash command interpreter. Each of these files contains commands and instructions to set up (or disable) various features that affect how the system responds to you.
The Setup Files in your Home Directory
Each new account has a default set of initialization files. These files have comments ( lines starting with #) defining what different commands do. You may wish to modify them according to your needs. Make sure to save a copy of the old files before changing anything. You can edit these files using any text editor.
Setting up your Terminal
As indicated in the section on Terminal Setup, the
command stty provides the user with a means to set up terminal characteristics
like setting the erase and kill keys to control keys such as
DEL and BACKSPACE.
stty -a displays a list of all terminal characteristics currently
in effect.
.bashrc File
In bash the export command can be used to select the desired
options. For instance,
% export HISTSIZE=100
Sets the shell to save the last 100 commands in the history buffer.
To turn off an option, the unset command can be used. Other shell variables such as prompt can also be similarly set up. Refer to the section on SHELL Commands.
To see what options are currently in effect in the bash shell, just type printenv with no arguments.
The .bashrc file can be used for setting up special variables called environment variables. Some of the shell variables such as path, user etc. get their values from the corresponding environment variable such as PATH, USER, etc.. Environment variables are passed along to subsequent commands and programs automatically.
To set an environment variable use export command. To see what environment variables are currently in effect use printenv command. To remove an environment variable use unset command. See the section on Environment Variables for more information on environment variables.
.bash_profile File
When the user logs in, the default shell performs instructions in the .bash_profile file. Subsequent invokings of any shell ignore the .bash_profile file.