LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   2> (https://www.linuxquestions.org/questions/linux-software-2/2-171823/)

liguorir 04-18-2004 07:39 PM

2>
 
For the following:

mkdir /tmp/newdir 2> /dev/null

What does the "2>" mean?

Please advise.

megaspaz 04-18-2004 07:44 PM

a long time since i've done that kind of scripting, but i believe the 2 represents standard output and the > redirects that output to /dev/null

AutOPSY 04-18-2004 11:35 PM

standard error actually 1 is all output.
2 is error.

mardanian 04-18-2004 11:38 PM

here is teh example , you have file1 in your home directory adn you issue command

ls file1 file2 2>A

as file2 doesn't exists, in this case the error output will be redirected to A (file)

and if you use like this

ls file1 file2 1>A

guess what would be in A ?

:)


All times are GMT -5. The time now is 05:36 PM.