可以是(理论上)以下rm之一:
- shell 内置命令(但是我不知道任何带有这种内置命令的 shell)
- 外部命令(很可能是 /bin/rm)
- 外壳函数
- 别名
如果你把它放在\它之前(或引用它的任何部分,例如"rm"或什至'r'm)shell 将忽略所有别名(但不是函数)。
正如 jlliagre 所提到的,您可以询问 shell 什么rm是内置的以及正在\rm使用什么。type
实验:
$ type rm
rm is /bin/rm
$ rm() { echo "FUNC"; command rm "$@"; }
$ type rm
rm is a function
$ alias rm='echo ALIAS; rm -i'
$ type rm
rm is aliased to `echo ALIAS; rm -i'
现在,我们有了 alias rm、 functionrm和原始外部rm命令:让我们看看如何相互调用:
$ rm # this will call alias, calling function calling real rm
$ rm
ALIAS
FUNC
rm: missing operand
$ \rm # this will ignore alias, and call function calling real rm
FUNC
rm: missing operand
$ command rm # this will ignore any builtin, alias or function and call rm according to PATH
rm: missing operand
要深入了解它,请参阅help builtin、 help command和。help aliasman sh