test
is a virtual command inside bash or what you could call a builtin
. /usr/bin/test
exists as well as an external command
. Along with builtins and commands there are also functions
which you can think of more like custom builtins. The priority on how they are called are: functions first, builtins second, external binaries or commands last; but you could customize that.
If you have somehow made a function that has the same name as a builtin e.g. cd
, to skip calling the function and call the builtin cd
instead, you could use the builtin command builtin
e.g. builtin cd args
.
Likewise if you have a builtin that has same name as a command stored in the filesystem e.g. test
, to call the command test
instead, either you give the explicit path e.g. /usr/bin/test
or use the builtin command command
e.g. command test -n xyz
.
To get more idea about it, try running these commands:
help
help builtin
help command