The general solutions for built-ins (for example test) are [1]:
use
env(all shells)$ env test external testdisable the builtin (only bash and zsh):
$ test 1 = 1 && echo "yes" yes $ enable -n test ### for bash. Re-enable with "enable test". $ disable test ### for zsh. Re-enable with "enable test". $ test external testuse any slash
/to call the command (all shells):$ test 1 = 1 && echo "yes" yes $ ~/bin/test external testmake an alias (fails inside a bash script, except if
shopt -s expand_aliasesis used):$ alias test='~/bin/test' ### remove with 'unalias test'. $ test external test
But time is not a builtin.
The word time is a "Reserved word", not a command and neither a built-in.
That enable this solutions:
Quote the word. This does not work with built-ins.
Many forms of quoting work:\time"time"'time'ti\meti"me", etc.$ time real 0m0.000s user 0m0.000s sys 0m0.000s $ \time Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose] [--portability] [--format=format] [--output=file] [--version] [--quiet] [--help] command [arg...]Use the builtin
command(this does not work with built-ins):$ command timeAs above for built-ins, using any slash
/works:$ /usr/bin/timeAs above for built-ins, an alias also work here:
$ alias time='command time' $ alias time='/usr/bin/time'
[1] Lets assume there is an external executable in ~/bin/test that prints "external test". And further: lets assume that ~/bin is ahead of /bin in the active PATH.