shell command ---- 2> & 1

Java -jar $ HOME the nohup / pserver9997.jar> $ HOME / the server.log 2> &. 1 & the server.log file # log output start the chat server to the HOME directory   

For & 1, more specifically, it should be a file descriptor, and a standard output is identified, sdout.

For 2, standard error, stderr.

2> & 1 means standard error is redirected to the standard output. Here the standard output has been redirected to the server.log, then the standard error will be redirected to the server.log.

Occasionally can & add the final order, so that the program represents the background.

 

Why 2> & 1 write in the back?

index.php task testOne >/dev/null 2>&1

 We can understand, on the left is the standard output, good, now standard output directly to / dev / null, whereas 2> & 1 is to redirect standard error to standard output, so when a program error, the error is equivalent to the flow on the left, while the left is still output to / dev / null in.

 

/ Dev / null is what is intended?

You can be / dev / null seen as a "black hole", which is equivalent to a write-only file, write all its contents will be permanently lost. While trying to read content from it there is nothing not read ~

Guess you like

Origin www.cnblogs.com/smdq/p/12049912.html