I know there is a simple syntax for telling bash not to expand aliases. However, Google is not turning it up and I'm too lazy to read through man bash. Also, the answer should be on this website.


Put a backslash before the first character.

$ alias ls="echo foo"
$ ls
$ \ls
| improve this answer | |
  • 4
    By the way, this is not a bash-specific feature. It's mandated by POSIX, and works in bash, ksh and zsh amongst others. – Gilles 'SO- stop being evil' Oct 16 '10 at 11:40

You can use command shell builtin command. It will execute only commands found in the PATH or shell builtins. It won't execute aliases or shell functions.


alias ls='ls -l'
$ ls
drwxr-xr-x 3 user user 4096 2010-10-11 13:17 dir1
drwxr-xr-x 3 user user 4096 2010-10-15 15:37 dir2
$ function ls() {
> echo hello
> }
$ ls
$ command ls
dir1  dir2
| improve this answer | |

Type shopt -u expand_aliases into the bash shell (the -u switch is for unset). I recommend reading the man page for shopt.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.