Why start a shell command with a backslash?
Solution 1:
alias curl='curl --some --default --options'
If you have an alias for curl
and you don't want to use it, putting a backslash in front disables the alias and runs the curl binary directly.
Note that this only applies at an interactive shell. Aliases don't take effect in scripts so it would be unnecessary there.
Solution 2:
The (Bourne/POSIX) shell specification says that alias substitution in an interactive shell is suppressed when any character of the command word is quoted. A backslash is one way to do that, but there are also other well known ways to quote: single and double quotes. All of the following will suppress alias substitution:
\curl
cur\l
\c\u\r\l
"c"url
"curl"
"c""u""r""l"
'curl'
'cu'"rl"
Using \curl
is just the most common and readable way. Since this is a standardized feature, you can expect it to work in all Bourne-heritage shells.
\curl
looks a bit like a TeX command, doesn't it? :-)