Home arrow Journal arrow Today Quick Tip: Redirect stdout and stderr to the same file
Today Quick Tip: Redirect stdout and stderr to the same file PDF
Wednesday, 24 February 2010
For example if you want to write a script and all your error and other messages to be redirected to a file you can use in every command at the end of the command the following: >/tmp/install.log 2>&1

For example if in a script you clone a hard drive you can use this:

dd if=/dev/ad0 of=/dev/ad1  bs=8M   >>/tmp/install.log 2>&1

This will log your output of the dd command to install.log.
Last Updated ( Wednesday, 24 February 2010 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?