As we mentioned in the last exercise, you can add settings and commands that execute every time a new terminal session is started. One type of setting you can create is called an alias:
alias command allows you to create keyboard shortcuts, or aliases, for commonly used commands.
alias pd="pwd" creates the alias
pd for the
pwd command, which is then saved in the bash profile.
pd alias will be available each time we open a new terminal session, and the output of
pd will be the same as the
source ~/.bash_profile will make the alias
pd available in the current session.
Let’s continue configuring the environment by adding command aliases.
Open ~/.bash_profile in nano.
In ~/.bash_profile, on a new line, type:
Save the changes and exit out of
Once you’ve exited nano and are back in the terminal, press the Enter key onto a new line.
To make the alias in the current terminal sessions, type
Let’s try out the alias. Type:
You should see the same output as you would by typing the