Take the 2-minute tour ×
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.

I'd like to be able to export the output (and error messages) of my cygwin terminal in a file, especially since I have to click a lot of buttons in order to "mark" the stuff in the cygwin terminal (and it's desirable to minimize the amount of clicking I do).

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The stderr output of an executable can be redirected to a file with the following syntax:

mycommand 2> error.txt

If you want to redirect stdout (i.e. the regular program output) to the file, the command should be:

mycommand > output.txt

To redirect both the stderr and stdout output to the same file (similar to as seen on terminal), use:

mycommand > output_and_error.txt 2>&1
share|improve this answer

Your Answer

 
discard

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.