How to redirct prorgram STDOUT/ERR to different location than /usr/bin/time STDOUT/ERR

12 Views Asked by At

Take something as simple as

/usr/bin/time ls -l

Lets say I want to redirect like so

lsstdout=a.out
lsstderr=b.err
timestdout=c.out
timestderr=d.err

How does one accomplish this?

1

There are 1 best solutions below

0
On BEST ANSWER

You can write like this if you don't mind running ls with another bash:

/usr/bin/time bash -c 'ls -l > ls.out 2> ls.err' > time.out 2> time.err