Under Linux/Unix, usually only the daemon can continue to execute without the terminal, and the normal process will exit when receiving the SIGHUP signal (suspend signal) when the terminal is shut down. . When the terminal exits, the background program started by the terminal automatically exits.
If you want the command to run in the background, you can use the & specified command to run in the background;
If the program does not stop running after the terminal exits, the background program can be started with the nohup command.
nohup(=no hang up), so that the command ignores the SIGHUP signal; [syntax] nohup Command [ Arg ... ] [&] [command output description]
Not redirected, either standard output (stdout) or standard error (stderr), redirected to the nohup.out file; nohup.out file is written by default in the current directory, if there is no write permission in the directory , trying to write to $HOME/nohup.out, if it still fails, the entire command fails;
If the command output is redirected, it will be written to the specified redirect file;
[Exit Status] 126 can find but can't call Command command; 127 nohup command error or command command cannot be found; otherwise it is the exit status of Command command; nohup and & difference: nohup just let the command ignore the SIGHUP command;
& let the command run in the background;
As to whether the command can continue to execute after leaving the terminal, it depends on whether the process is a daemon, if not, then nohup is needed to help;
PS, reference http://www.cnblogs.com/allenblogs/archive/2011/05/19/2051136.html< Br>
---------The following is the reference content
When he prompts nohup in the shell, he still needs to press any key on the terminal to return it. Go to the shell and enter the command window, then exit the terminal by typing exit in the shell; and I will close the terminal by clicking the Close button directly after the nohup is successfully executed. Therefore, the session corresponding to the command will be disconnected at this time, and the process corresponding to nohup is notified that it needs to be shut down together.
This detail has not been noticed like me, so record it here.
1.Last Command
Introduction to linux last Command
Description: Lists information about users who have logged into the system in the past.
Syntax: last [-adRx][-f
-d ] [ -k
1, need to upload or download, you need to use the rz and sz commands. If you do not have th
Cause The application is deployed into the virtual pool, and the virtual machine is missing the gcc
1 U disk or disk mount under virtual machine, network configuration under Ubuntu, switch bet
11 cool Linux terminal commands Daquan
Linux how to view the size of the hard disk
Sort|uniq| Cut| Wc (my first markdown note)
Add and remove environment variables PATH path in Linux system
Linux learning process, threads and programs
Understanding the Linux Process
Detailed use of rz and sz commands in Linux
Linux mount hard disk error "you must specify the filesystem type"
Win10 installed capacity exceeded 200 million mark, PC end accounted for 82%
Windows 7 installation method is fully collected
Set the idea of Win 8 system automatic configuration script
Why does the IE8 browser click on the page under the Windows7 system has a murmur
Display multi-core mode method under Linux
How to use Win10 picture password Win10 picture password setting method
Another trick after losing the XP password
Windows8 installation full map tour and Win8 installation tutorial! (3)