If you set up a .bash_aliases file for terminal command shortcuts, but when you try to run them you’re told the commands don’t exist, then the following tip should get them recognised. It seems that in recent versions of Ubuntu, the file ~/.bashrc has the option for recognising .bash_aliases commented out. I found this can happen after an upgrade as well, so if you suddenly can no longer run your aliases, you’ll need to follow this tip too.
The following is what the aliases section in .bashrc should look like:
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
You’ll probably find a hash (#) before the command starting with “if“, so remove that, and any others in the two lines below it. Leave the hashes above the command, as those lines are comments. Once you save .bashrc, you should be able to use your command shortcuts immediately thereafter.
Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!