Meaning nohup command 2> & 1 to &

nohup command 2> & 1 & meanings:

 

nohup: no hang up, meaning not hang up. Permanent represents the execution order, even if the current terminal has Log.

&: Background execute the command.

 

2>&1:

In the bash shell,

0 represents the standard input, keyboard input is generally;

1 represents the standard output, typically a screen;

2 represents standard error;

When therefore command nohup & run, the standard errors are output to 2 to go, console not seen the error output.

Therefore, 2> & 1 redirects all played a role, the standard error is redirected to standard output up, running in the background you can see the output of the error in the program on the screen.

 

eg. nohup bin/hive --service hiveserver2 2>&1 &

Guess you like

Origin www.cnblogs.com/mediocreWorld/p/11117814.html