Location of "~/.bash_aliases"
Yes, just create it in your home directory.
touch ~/.bash_aliases
or open an empty file in a text editor, e.g.,
gedit ~/.bash_aliases
This should be one of your first aliases..
##### ea - alias for editing aliases
#
#When setting up a new aliases file, or having creating a new file.. About every time after editing an aliases file, I source it. This alias makes editing alias a
#bit easier and they are useful right away. Note if the source failed, it will not echo "aliases sourced".
#
#Sub in gedit for your favorite editor, or alter for ksh, sh, etc.
#
alias ea='gedit ~/.bash_aliases; source ~/.bash_aliases && source $HOME/.bash_aliases && echo "aliases sourced --ok."'
#
When you run across something that would be a good alias, enter ea
, a text editor opens. Add your new alias. Close the editor. The alias automagically sources; makes the new alias immediately available; and you're on your way.
~/.bash_aliases
is a full path already. The tilde (~
) is expanded by the shell (and many other applications) to your full home path (aka $HOME
, usually /home/$USER
).
It doesn't exist by default, so just create one.