我正在尝试运行命令
time -f "\t%E real,\t%U user,\t%S sys" ls -Fs
在我的 zsh 上,但我得到了
zsh: command not found: -f
但是我从 man docs of time 中得到了这行代码。
这是zsh的问题吗?
zsh
内置函数(正如你现在所知道的time
)没有-f
选择;相反,您设置了 shell 参数的值TIMEFMT
$ TIMEFMT=$'\t%E real,\t%U user,\t%S sys'
$ time ls -Fs
尝试/usr/bin/time -f "\t%E real,\t%U user,\t%S sys" ls -Fs
我在这里找到了这个答案