Skip to content

unalias Command Cheat Sheet

unalias removes entries from the list of defined aliases.


Synopsis

unalias [name...]
unalias -a

Basic Usage

Remove a Specific Alias

If you have alias ll='ls -l', remove it:

unalias ll

Remove All Aliases (-a)

Clears every alias defined in the current shell.

unalias -a

Why Use It?

Temporarily Bypassing an Alias

If cp is aliased to cp -i (interactive), but you want to force overwrite in a script loop.

Option 1: Unalias

unalias cp
cp *.txt /dest/

Option 2: Backslash (Better) Prefixing a command with \ ignores the alias.

\cp *.txt /dest/

Notes

  • Scope: unalias only affects the current shell session. To permanently remove an alias, delete it from your shell profile (~/.bashrc, ~/.zshrc).