What is the easiest way to execute the original ls?

You wish to execute the ls command, but it appears to be aliased. What is the easiest way to execute the original ls?

You wish to execute the ls command, but it appears to be aliased. What is the easiest way to execute the original ls?

Answer: ls

Explanation:
see http://en.wikipedia.org/wiki/Alias_%28command%29#Overriding_aliases

In Unix shells, if an alias exists for a command, it is possible to override the alias by surrounding the command with quotes or prefixing it with a backslash. For example, consider the following alias definition:
alias ls=’ls -la’
To override this alias and execute the ls command as it was originally defined, the following syntax can be used:
‘ls’
or
ls



Leave a Reply 2

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


Simon

Simon

Hi Admin, you have missed off the backslash on the second ls (ie. \ls)

Steven

Steven

alias ls=”ls -al”

Such an alias can be disabled temporarily and the core command called by preceding it directly (i.e., with no spaces in between) with a backslash, i.e.,

\ls