Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

this command is to redirect output of time to with multiple args:

$ time wc test >wc.out 2>time.out

unix programming environment book shows that the error output of time redirects to time.out, but it seems that it's treating the 2>time.out portion as part of the wc command and not redirecting the error output to time.out as I expected, so what is the problem?

share|improve this question

1 Answer 1

The usual solution to this problem is to put your time command in a group:

$ { time wc test >wc.out; } 2>time.out
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.