An alias for ls
command in ~/.bashrc
file aliased with this one:
alias ls='ls --color=auto'
then, when I run ls
command in terminal aliased ls
(ls --color=auto
) runs. but my question is how can I run original ls
only and only ls
alone without extra argument and without solving problem with deleting aliased entry? since when I delete this entry I can run it in simple ls
.
You can bypass aliases by the following methods:
the full pathname of the command:
/bin/ls
command substitution:
$(which ls)
the command builtin:
command ls
double quotation marks:
"ls"
single quotation marks:
'ls'
a backslash character:
\ls
Suspend alias expansion
You could also disable alias expansion for all aliases temporarily, without deleting them:
To enable them:
Note that alias expansion is disabled by default in scripts, but set by default in interactive shells.
You can disable an alias using
\
in front of command.So to run the original
ls
command you need to run it using\ls
For example
First creating alias of
ls
command.(and many more...)
Output of original
ls
using\
which override the alias.You could add
command
before the aliased command, e.g.Or run the original executable by combining
which
It will return
/bin/ls
, therefore withor
you could execute that file directly.
You can also run the command from its original location
/bin/ls
instead ofls