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

前端 未结 7 1540
甜味超标
甜味超标 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:31

    I use the redirection of stdout and stderr method with braces for testing.
    The &>>rpt represents this >>rpt 2>&1 but shorter.
    The braces will execute a command(s) in the current shell.   See: man bash

    { time ls a*; } &>>rpt
    

提交回复
热议问题