Hava alias shortcut available in new terminal session
To have your alias definitions available anytime, define them in your .bashrc
file. It is a hidden file in your home directory, and is executed automatically each time you open a terminal.
Open that file with your text editor. A good place to add your own aliases is where some aliases are already defined. You will find a comment line: # some more ls aliases
. There, you can add your own aliases. Save and close the file when done. From now on, your new aliases will be available in any new terminal.
If you maintain a lot of aliases, it is more practical to create a separate file with the name ~/.bash_aliases
and put all your alias definitions there. Ubuntu is set up to automatically source an existing .bash_aliases
file in .bashrc
.