Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect output eg 2>&1

Status
Not open for further replies.

vodkadrinker

Technical User
May 16, 2002
163
GB
Can anyone point me in the right direction as to what each number stands for in a redirect.

2 = standard errors etc..

What I want to do is send the errors to a logfile and to the screen at the same time.

Example line
umount /datafilesystem > /tmp/logfile 2>&1

This will send the output to the file but not to the screen.

Thanks
VD
 
man tee vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks vlad

Just incase anyone else needs to know the command looks like this.

umount /datafilesystem 2>&1|tee -a /tmp/logfile

This will send both standard output and errors to both the screen and the log file.

0=stdin
1=stdout
2=stderr

VD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top