TL;DR: As Gunnar Hjalmarsson says, put aliases in
The commands in
~/.profile are run by login shells. That file is a good place to do things that should be done once at the beginning of each session but not repeated every time a new shell is started.
~/.profile is good for setting environment variables, which will be inherited by all descendant processes.
Aliases are not inherited, and the shell you get in a terminal window in Ubuntu is not (by default) a login shell. To define aliases for all your interactive Bash shells, the definitions need to be somewhere where they'll be run each time you start such a shell.
The usual places are either in:
New interactive non-login shells source
~/.bashrc (as do some noninteractive shells). Your
~/.profile, by default, sources
~/.bashrc in Ubuntu checks if
~/.bash_aliases exists and sources it.
I recommend putting new aliases in
~/.profile works to define the aliases, but it also re-runs everything else in that file, most of which you don't need to run again, and some of which might do things you don't want. For example,
~/.profile checks if
~/bin exists and, if so, prepends it to your
$PATH. If you source
~/.profile multiple times, you can get the same directory appearing multiple times in
$PATH. This would have to happen quite a lot to cause a significant performance problem. But even one extra occurrence can cause confusion when you're inspecting the output of a command like
If your aliases aren't defined even in initial login shells, such as when you log in from a virtual console or via SSH, then as Kulfy alludes to the issue may be that you have a
~/.bash_login file. If such a file exists, Bash login shells source it instead of
~/.profile. Most often you would not want to have either such file on Ubuntu, and if you did, you would most likely want it to source
~/.profile so that the commands in
~/.profile still run.
But even if that is the case, you shouldn't define aliases in
~/.profile (nor in
~/.bash_login), as that doesn't define them in non-login shells.