nohup the linux environment to perform jar

java -jar XXX.jar &
end of the command is not "&", becomes "java -jar XXX.jar", indicates the current ssh window, press CTRL + C interrupted run or close the window, the program proceeds directly quit
command at the end add "&" becomes "java -jar xXX.jar &", it indicates when the window is closed, the program will abort operation. & Let on behalf of the command in the background.
nohup java -jar XXX.jar> Log.log &
or
nohup java -jar XXX.jar >> Log.log &
command "nohup java -jar XXX.jar &" section, said they did not hang up the Run command, when the account or withdraw when the terminal is turned off, the program is still running. Note that all output is redirected to the job nohup.out file.
Command "nohup java -jar XXX.jar> Log.log & " section, run command indicates not hang up, or when the account exit terminal is closed, the program is still running, and all of the job output is redirected to the Log.log file. "> Log.log" This command is to specify the log file output.
">>" indicates that the additional output will be redirected to Log.log the way.
nohup java -jar XXX.jar> Log.log 2> & 1 &
or
nohup java -jar XXX.jar >> Log.log 2> & 1 &


Standard input file (stdin): stdin file descriptor is 0, Unix default program data read from stdin.
Standard output file (stdout): stdout file descriptor 1, Unix program default data output to stdout.
The standard error file (stderr): stderr file descriptor 2, Unix program writes error information to stderr stream.
Shielded output, play a role in prohibiting output: / dev / null is a special file, its contents will be written to be discarded; if you try to read from the file, then nothing can not read. However, / dev / null file is very useful to redirect the output of a command to it, it will play the effect of "No Output".
"> Log.log 2> & 1" : said it would redirect stdout and stderr after the merger to Log.log
NOTE: After the output, you can use the "jobs" look at the tasks running in the background.

Guess you like

Origin www.cnblogs.com/jtlgb/p/11671122.html