~/.bashrcare shell scripts that contain shell commands. These files are executed in a user's context when a new shell opens or when a user logs in so that their environment is set correctly. As we mentioned
~/.bash_profileis executed for login shells and
~/.bashrcis executed for interactive non-login shells.
~/.bash_profilescript is executed before the initial command prompt is returned to the user. After that, every time a new shell is opened, the
~/.bashrcscript is executed.
Most of the time PATH and env vars go into the in ~/.bash_profile and aliases go into the ~/.bashrc.
aliascommand and remove them with the
Another common use of aliases is for the root user. The
mvcommands are usually aliased to include the
-iparameter, to help prevent accidental destruction of files.
$1returns the first argument