小编Dav*_*man的帖子

让 bash 使用外部 `time` 命令而不是内置的 shell

如何让 bash 默认使用时间二进制文件 (/usr/bin/time) 而不是 shell 关键字?

which time返回/usr/bin/time
type time返回time is a shell keyword
运行time显然是在执行shell关键字:

$ time

real    0m0.000s
user    0m0.000s
sys     0m0.000s
$ /usr/bin/time
Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]
   [--portability] [--format=format] [--output=file] [--version]
   [--quiet] [--help] command [arg...]
Run Code Online (Sandbox Code Playgroud)

enable -n time 返回 bash: enable: time: not a shell builtin

bash shell-builtin time-utility

28
推荐指数
3
解决办法
8396
查看次数

标签 统计

bash ×1

shell-builtin ×1

time-utility ×1