How can I redirect the output of the “time” command?

前端 未结 7 1522
甜味超标
甜味超标 2020-11-30 19:19

I tried to redirect the output of the time command, but I couldn\'t:

$time ls > filename
real    0m0.000s
user    0m0.000s
sys     0m0.000s
7条回答
  •  [愿得一人]
    2020-11-30 19:43

    you can redirect the time output using,

    (time ls) &> file
    

    Because you need to take (time ls) as a single command so you can use braces.

提交回复
热议问题