当寻找的路径,可执行文件或检查,如果你在Unix shell中输入命令的名称会发生什么,有不同的公用事业过多(which
,type
,command
,whence
,where
,whereis
,whatis
,hash
,等)。
我们经常听说which
应该避免。为什么?我们应该用什么来代替?
所有 shell 内置函数共享相同的手册页:
BUILTIN(1) BSD General Commands Manual BUILTIN(1)
NAME
builtin, !
Run Code Online (Sandbox Code Playgroud)
等等。
然后有一小段文字描述了什么是 shell 内置函数,然后是一个看起来像这样的列表:
Command External csh(1) sh(1)
! No No Yes
% No Yes No
Run Code Online (Sandbox Code Playgroud)
但是如果我们这样做,man grep
我们会得到诸如
等等。
难道 shell 内置函数没有自己的历史、描述和参数,比如-A
或-r
?为什么手册页中没有提供,我将如何学习正确有效地使用它们?