0

I'm running command xxx xxx in linux, and I want to redirect all output, including std/warn/err output into one file IN ORDER.

How to deal with this?

For example, if I run command xxx xxx 2>file, the file will only contains error message. If I run command xxx xxx 1>file, the file will only contains std message. But I want all message together, not devided message. How to deal with this?

Thank you!

1

2 Answers 2

1

I think you are looking for this:

command >outfile 2>&1.
Sign up to request clarification or add additional context in comments.

Comments

0

You could also use this simpler way

$ command arg1 arg2 >& command.out

This is typical C shell way but works well on most advanced shells such as bash.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.