How do you redirect the standard error of a command to a file?

Man Ly

New member
How do you redirect the standard error of a command to a file?
Answer
To redirect stderr as well, you have a few choices:
  1. Redirect stdout to one file and stderr to another file: command > out 2>error.
  2. Redirect stdout to a file ( >out ), and then redirect stderr to stdout ( 2>&1 ): command >out 2>&1.
 

Tìm kiếm

Back
Top