I know this much:
$ command 2>> error
$ command 1>> output
Is there any way I can output the stderr to the error file and output stdout to the output file in the same line of bash?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just add them in one line
command 2>> error 1>> outputHowever, note that
>>is for appending if the file already has data. Whereas,>will overwrite any existing data in the file.So,
command 2> error 1> outputif you do not want to append.Just for completion’s sake, you can write
1>as just>since the default file descriptor is the output. so1>and>is the same thing.So,
command 2> error 1> outputbecomes,command 2> error > output