Standard Error
In addition to standard input and standard output, there is another place known as standard error. This is where most Unix commands write their error messages. And as with the other two "standard" places, standard error is associated with your terminal by default. In most cases, you never know the difference between standard output and standard error:
[root@server1 ~]# ls n*
ls: n*: No such file or directory
[root@server1 ~]# ls n* > foo
ls: n*: No such file or directory
You can also redirect standard error to a file by using the notation
command 2> file
[root@server1 ~]# ls n* 2> errors [root@server1 ~]# cat errors ls: n*: No such file or directory
Comments
Post a Comment