Let's assume that you always forget that the command free -h displays the memory information of your system:
elliot@ubuntu-linux:~$ free -h
total used free shared buff/cache available
Mem: 3.9G 939M 2.2G 6.6M 752M 2.7G
Swap: 947M 0B 947M
You may be asking yourself: "Why can't I just type memory to display the memory information instead of free -h?". Well, you certainly can do that by creating an alias.
The alias command instructs the shell to replace one string (word) with another. Well, how is this useful? Let me show you; if you run the following command:
elliot@ubuntu-linux:~$ alias memory="free -h"
Then every time you enter memory, your shell will replace it with free -h:
elliot@ubuntu-linux:~$ memory
total used free shared buff/cache available
Mem: 3.9G 936M 2.2G 6.6M 756M 2.7G
Swap: 947M...