English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I wanted to capture the error into a file as well as display the error in stdout. My friend gave me this command. I know that tee captures the output/error into a file but really, how does the given command work?

2007-01-23 17:25:04 · 2 answers · asked by javanewbie 1 in Computers & Internet Programming & Design

2 answers

You understood Tee only half of what it does, it stands for T-bone, it copies and T-boning a stream of input into 2 streams of identical outputs, one stdout, the other err.txt as the command says.

2007-01-23 17:30:55 · answer #1 · answered by Andy T 7 · 0 0

In unix, 0,1 and 2 are file descriptors corresponding to stdin (standard input), stdout (standard output) and stderr (standard error).

2>&1 is redirecting standard error into standard output. So, along with standard output and standard error, everything will be present in err.txt

2007-01-24 01:34:23 · answer #2 · answered by maddi_rajagopal 2 · 0 0

fedest.com, questions and answers