Let's create another temporary alias named lastline that will display the last line in a file:
elliot@ubuntu-linux:~$ alias lastline="tail -n 1"
Now let's try our new alias on the /home/elliot/.bashrc file:
elliot@ubuntu-linux:~$ lastline /home/elliot/.bashrc
alias date="date;cal"
Alright! It works well. Now, if you wish to delete the alias, then you can run the unalias command followed by the alias name:
elliot@ubuntu-linux:~$ unalias lastline
So now the lastline alias has been deleted:
elliot@ubuntu-linux:~$ lastline /home/elliot/.bashrc
lastline: command not found
You can also use the unalias command to temporarily deactivate a permanent alias. For example, if you run the following command:
elliot@ubuntu-linux:~$ unalias memory
Now, the permanent alias memory will not work in the current Terminal session:
elliot@ubuntu-linux:~$ memory
Command 'memory' not found, did you mean:
command 'lmemory' from deb lmemory
Try...