Using a text editor, open your
.bashrc file, which is typically found in your home directory.
This file is loaded whenever a new bash instance is started and should included bash-specific commands, like aliases.
The anatomy of an alias is as follows:
alias alias_name="text to alias"
Here is a common example:
alias ll="ls -lha"
This means that whenever you type
ll, it will be as if you had typed
It is basically a substitution, so if you have an alias set up like this:
alias g="git". Then you can type
g pull, which will execute
If you'd like to use your alias, you can either open a new bash shell, or source your
.bashrc file in your current shell using:
This basically executes everything in your
.bashrc file as if you had typed each command.