How to Clear all BASH shell aliases?

How can I clear all UNIX bash shell aliases in one command? I just need to delete them in current session. You need to use unalias command, its syntax:

unalias name

To remove alias called foo, enter

$ unalias foo

alias command with no arguments or with the -p option prints the list of aliases:
Output:

alias ll=’ls -lh’
alias ls=’ls –color=auto’
alias vi=’vim ‘
alias c=’clear’
alias d=”/usr/local/bin/chkdomain $@”

Clear all Linux / UNIX bash shell aliases

It will remove NAMEs from the list of defined aliases. If the -a option is given, then remove all alias definitions.

$ unalias -a

Share Button

Leave a comment

Your email address will not be published. Required fields are marked *