Redirecting Error Messages to a File

To redirect the standard error stream to a file, use the `>' operator preceded by a `2'. Follow a command with 2> and the name of the file the error stream should be written to.

To redirect the standard error of apropos shell bash to the file `command.error', type:

$ apropos shell bash 262; command.error RET

As with the standard output, use the `>>' operator instead of `>' to append the standard error to the contents of an existing file.

To append the standard error of apropos shells to an existing file `command.error', type:

$ apropos shells 262;62; command.error RET

To redirect both standard output and standard error to the same file, use `&>' instead. · To redirect the standard output and the standard error of apropos shells to the file `commands', type:

$ apropos shells 38;62; commands RET

Posted on: 15/12/2009








0 Comments
If you want to leave a comment please Login or Register
New Debian stable release......
OpenSuSE 11.3......
The Origins of Linux......
Use fdisk to Create a Swap Partition......
Checking In a File Revision......