PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

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

2 Comments on “What is the easiest way to execute the original ls?

  1. Steven says:

    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




    0



    0

Leave a Reply