Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the DOS equivalent of 1>/dev/null? [duplicate]

Tags:

dos

dev-null

I want to suppress the output of my script running under DOS, similar to the following under a *nix environment:

 $ command 1>/dev/null

How can I do this?

like image 617
Zaid Avatar asked Mar 21 '11 18:03

Zaid


People also ask

What is the Windows equivalent of dev Null?

and NUL is Windows' equivalent of /dev/null .

What does >/ dev null 2 >& 1 mean?

/dev/null is a special filesystem object that discards everything written into it. Redirecting a stream into it means hiding your program's output. The 2>&1 part means "redirect the error stream into the output stream", so when you redirect the output stream, error stream gets redirected as well.

What means 2 >/ dev null?

After executing the ping command, '>/dev/null' tells the system to suppress the output, and '2>&1' directs the standard error stream to standard output. In this way, all output of the command is discarded.

What does the following command do ?: Ls this that madeup 2 >/ dev null?

Specifying 2>/dev/null will filter out the errors so that they will not be output to your console. In more detail: 2 represents the error descriptor, which is where errors are written to. By default they are printed out on the console. /dev/null is the standard Linux device where you send output that you want ignored.


1 Answers

It should be >NUL on both DOS and Windows console.

like image 106
geekosaur Avatar answered Sep 20 '22 14:09

geekosaur