我运行从时间的手册复制的命令,但它没有找到-f命令.为什么它将-f识别为命令?
$ time -f "%E real,%U user,%s sys" ls -Fs
-f: command not found
real 0m0.152s
user 0m0.108s
sys 0m0.040s
Run Code Online (Sandbox Code Playgroud)
我怀疑shell并决定尝试另一个shell.在上面,shell是bash.我切换到破折号,现在发现时间正确.
我的系统是Linux Mint 13.
您可以使用bash内置command来抑制shell函数和内置函数:
command time -f "%E real,%U user,%s sys" ls -Fs
Run Code Online (Sandbox Code Playgroud)
(比使用更长,但更明确一点\time.)