6

我正在尝试运行命令

time -f "\t%E real,\t%U user,\t%S sys" ls -Fs

在我的 zsh 上,但我得到了

zsh: command not found: -f

但是我从 man docs of time 中得到了这行代码。

这是zsh的问题吗?

4

2 回答 2

7

zsh内置函数(正如你现在所知道的time)没有-f选择;相反,您设置了 shell 参数的值TIMEFMT

$ TIMEFMT=$'\t%E real,\t%U user,\t%S sys'
$ time ls -Fs
于 2013-03-07T16:53:52.440 回答
5

尝试/usr/bin/time -f "\t%E real,\t%U user,\t%S sys" ls -Fs

我在这里找到了这个答案

于 2013-03-07T01:53:09.093 回答