"Go" Linux under the Nohup command to exit the terminal after the program continues to run in the background

Source: Internet
Author: User
Tags exit in

Unix/linux generally want to let a program run in the background, many use & at the end of the program to let the program run automatically, but if you want to exit the terminal, the program is still running in the background, you have to use Nohup and & combination to achieve.

Nohup command

Purpose: To run the command without hanging off

Syntax: Nohup Command [Arg ...] [&]

Description: The nohup command runs commands specified by the command parameter and any related arg parameters, ignoring all hang-up (SIGHUP) signals. Use the Nohup command to run a program in the background after logging off: To run the nohup command in the background, you need to add & to the end of the command.

Log records:

The output is appended to the Nohup.out file in the current directory, regardless of whether the output of the Nohup command is redirected to the terminal. If the nohup.out file for the current directory is not writable, the output is redirected to the $home/nohup.out file. If no file can be created or opened for appending, then the command specified by the commands parameter is not callable.

Note When using:

After the shell has been prompted to nohup successful, you also need to press the terminal keyboard any key to return to the Shell Input Command window, and then by entering exit in the Shell to exit the terminal, if the nohup after successful execution of the program button to close the terminal, This time will be broken the corresponding session of the command, resulting in the nohup corresponding process is notified to need to shutdown together, do not have to shut down the terminal after the call program continues to run the role of the background.

Cases:

Nohup/etc/mha/bin/masterha_manager--conf=/etc/mha/app1.cnf--remove_dead_master_conf--ignore_last_failover &

"Go" Linux under the Nohup command to exit the terminal after the program continues to run in the background

Related Article

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.