use*_*135 6 man tcsh shell-builtin
我最近遇到了 command where
,它提供了 Linux 中可执行文件的实际路径。我知道which
, whereis
,locate
和 find
,但没有where
。
我想知道这个命令是什么时候引入的,为什么它的手册不可用。这个 shell 命令是特定于 C Shell 的还是所有 shell 都有这个where
命令?
我知道的唯一具有内置命令的 shellwhere
是tcsh
and zsh
。在该 shell ( man tcsh
/ man zshbuiltins
)的手册页中,您可以找到定义:
where command (+)
Reports all known instances of command, including aliases, builtins and
executables in path.
Run Code Online (Sandbox Code Playgroud)
因此它是内置的 -tcsh
等价物(没有):bash
type
tcsh
type
tcsh$ where where
where is a shell built-in
tcsh$ where echo
echo is a shell built-in
/bin/echo
Run Code Online (Sandbox Code Playgroud)
csh 中的 shell 内置命令在哪里
where where
where is a shell built-in
Run Code Online (Sandbox Code Playgroud)
zsh 中也提供了内置函数。
linux 命令称为which
. 如果您习惯使用 c-shell,这可能是内置的。Bash 内置命令通过 bash 内置命令进行记录help
。
来自维基百科:tcsh
内置 where 命令。与 which 命令类似,但显示 $PATH 中指定的目录中目标命令的所有位置,而不是仅显示将使用的目录。
所以我是对的:where 命令是 tcsh 内置命令,不能作为外部命令使用。如果你付给我 250 美元,我会为你写一些 C 命令;)
归档时间: |
|
查看次数: |
752 次 |
最近记录: |