The Bash shell can be configured by various files that affect its behavior, such as setting environment
variables, aliases, functions, options, and prompts. Some of these files are global, meaning they
apply to all users of the system, and some are local, meaning they apply to individual users. The
global files are usually located in the /etc directory, while the local files are usually located in the
user’s home directory, which is denoted by the tilde (~) symbol1.
The local files that affect the Bash shell are:
~/.bash_profile: This file is executed when a user logs in to the system. It is used to set up the user’s
environment, such as the PATH, the default editor, the umask, and other variables. It can also run
commands that are needed only once per login session, such as ssh-agent or fortune. This file can
also source other files, such as ~/.bashrc, to inherit their settings12.
~/.bashrc: This file is executed when a user starts a new interactive shell, such as opening a terminal
window or running a script with the shebang #!/bin/bash. It is used to set up the user’s shell
p