为什么用反斜杠启动 shell 命令? [英] Why start a shell command with a backslash?

查看:26
本文介绍了为什么用反斜杠启动 shell 命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

curl -L https://get.rvm.io | bash -s stable

为什么命令以 开头?这是我看到的网站.

Why is the command starting with ? This is the site where I saw it.

推荐答案

alias curl='curl --some --default --options'

如果您有 curl 的别名并且不想使用它,则在前面放置反斜杠会禁用别名并直接运行 curl 二进制文件.

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.

请注意,这仅适用于交互式 shell.别名在脚本中不起作用,因此在那里没有必要.

Note that this only applies at an interactive shell. Aliases don't take effect in scripts so it would be unnecessary there.

这篇关于为什么用反斜杠启动 shell 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆