Linux deploy jar package and specify the log file output

1, first understand the meaning of 1 and 2 represent in Linux

name Code Operators Java said Under Linux file descriptor (Debian, for example)
stdin (standard input) 0 < 或 << System.in /dev/stdin -> /proc/self/fd/0 -> /dev/pts/0
stdout (standard output) 1 >, >>, 1> 或 1>> System.out /dev/stdout -> /proc/self/fd/1 -> /dev/pts/0
stderr (standard error) 2 2> or 2 >> System.err /dev/stderr -> /proc/self/fd/2 -> /dev/pts/0

2, the meaning of the 2> & 1

The standard error output is redirected to standard output.

Symbols> & a whole.

3, the output log file and view

cd to the directory xxx.jar execution:

Java -jar xxx.jar the nohup> xxx.log> 2> &. 1 & - log write operation to the jar package and the xxx.log

-f xxx.log tail  - view the log file

Guess you like

Origin www.cnblogs.com/guduershi/p/12144565.html