mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Ignore The Alias When Running A Command as a unix til
This commit is contained in:
29
unix/ignore-the-alias-when-running-a-command.md
Normal file
29
unix/ignore-the-alias-when-running-a-command.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Ignore The Alias When Running A Command
|
||||
|
||||
I have a number of shell aliases set up to override one command with another.
|
||||
For instance, I want to run `bat` anytime I type `cat`, so I have `alias
|
||||
cat=bat` in my shell configuration.
|
||||
|
||||
But what if I were to ever want to run `cat` instead of `bat`?
|
||||
|
||||
Aliases can be ignored several ways:
|
||||
|
||||
1. Precede the command with a backslash.
|
||||
|
||||
```bash
|
||||
$ \cat
|
||||
```
|
||||
|
||||
2. Wrap the command in quotes.
|
||||
|
||||
```bash
|
||||
$ 'cat'
|
||||
```
|
||||
|
||||
3. Pass the command to `command`.
|
||||
|
||||
```bash
|
||||
$ command cat
|
||||
```
|
||||
|
||||
[source](https://unix.stackexchange.com/questions/39291/run-a-command-that-is-shadowed-by-an-alias)
|
||||
Reference in New Issue
Block a user