Linux using Nohup background to run the JAR package program __linux

Source: Internet
Author: User

The Linux Run Jar Pack command is as follows:

Mode one:

Java-jar Xxx.jar

Features: The current SSH window is locked, you can press CTRL + C interrupt the program to run, or directly close the window, program exit

How to keep the window unlocked.

Mode two

Java-jar Xxx.jar &

& Reps run in the background.

Specific: The current SSH window is not locked, but the program aborts when the window is closed.

Continue to improve, how to let the window shut down when the program is still running.


Mode three

Nohup Java-jar Xxx.jar &

Nohup means not to hang up the Run command, the program still runs when the account exits or the terminal closes

When a job is executed with the nohup command, all output of the job is redirected to the Nohup.out file by default, unless the output file is otherwise specified.


Mode Four

Nohup Java-jar Xxx.jar >temp.txt &

Explain the >temp.txt.

Command >out.file

Command >out.file redirects the command's output to the Out.file file, where the output does not print to the screen, but is output to the Out.file file.


Background run tasks can be viewed through the jobs command

Jobs

All background-performed jobs are listed, and there is a number in front of each job.
If you want to recall a job to the foreground control, you only need FG + number.

FG 23


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.