Let's say i have the following alias in bash - alias ls='ls --color=auto' - and i want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround?
|
|
|
You can also prefix a back slash to disable the alias: Edit: Other ways of doing the same include: Use "command": Use the full path: Use full path through command substitution: Quote the command: |
|||||||||||||||
|
|
That's what the Try
This tells the shell to bypass aliases and functions. |
|||||||||||||||
|
|
The alias is just a defined shortcut. In this example, the alias defined is the string So executing just You could also change the alias to something different, or add a new alias that executes just |
||||
|
|
Another way, building upon uther's answer, is to use
Undoubtedly, simply prefixing the command with a UPDATE: According to How to use `which` on an aliased command?, this doesn't seem to be reliable at all. |
|||||||||||||||
|
|
Typing the command in uppercase seems to work, like |
|||||||||||||||||
|
|
Personally, I just avoid defining aliases with the same names as commands, so I find that the OS's assumptions about which options I might prefer (overriding the assumptions of the designers of the YMMV, and the other solutions are of course still good to know. |
|||
|
|