Difference between revisions of "Terminal Process Management"
(Created page with "NOHUP - ignore the HUP (hangup) signal. POSIX Compliant. When using the command shell, prefixing a command with nohup prevents the command from being aborted automatically w...") |
|||
Line 6: | Line 6: | ||
The job remains connected to the terminal but is no longer listed in the job table. | The job remains connected to the terminal but is no longer listed in the job table. | ||
+ | |||
+ | == nohup == | ||
+ | |||
+ | == disown == | ||
+ | |||
+ | == ampersand control operator == | ||
+ | |||
+ | In the bash shell the ampersand "&" is a control operator with two common forms, the single "&" and the double "&&" ampersand. | ||
+ | |||
+ | When the single & is used at the end of the command line the command is forked to run as a job while the shell returns to zero status (you get the command prompt back). The process will not be detached from the terminal in that if the terminal dies the process will soon follow. | ||
+ | |||
+ | Furthermore, when a single & is placed between commands on the same line it will effectively delimit each command to run at the same time, all kicked off and running while the shell returns to zero status. | ||
+ | |||
+ | Not to be confused with using a single & between commands, the use of the double ampersand "&&" is used to separate commands entered on the same command line however they will NOT be ran all at the same time. The first will run and must exit prior to the next, just as though each was on individual lines in a shell script. If the preceding command fails the next will NOT run. | ||
+ | |||
+ | |||
[[Category:Computer_Technology]] | [[Category:Computer_Technology]] | ||
[[Category:Linux]] | [[Category:Linux]] |
Revision as of 12:35, 9 January 2019
NOHUP - ignore the HUP (hangup) signal. POSIX Compliant.
When using the command shell, prefixing a command with nohup prevents the command from being aborted automatically when you log out or exit the shell.
DISOWN - relinquish job from shell job management. disown can be used after a command has been launched while nohup must be used before. Not POSIX.
The job remains connected to the terminal but is no longer listed in the job table.
nohup
disown
ampersand control operator
In the bash shell the ampersand "&" is a control operator with two common forms, the single "&" and the double "&&" ampersand.
When the single & is used at the end of the command line the command is forked to run as a job while the shell returns to zero status (you get the command prompt back). The process will not be detached from the terminal in that if the terminal dies the process will soon follow.
Furthermore, when a single & is placed between commands on the same line it will effectively delimit each command to run at the same time, all kicked off and running while the shell returns to zero status.
Not to be confused with using a single & between commands, the use of the double ampersand "&&" is used to separate commands entered on the same command line however they will NOT be ran all at the same time. The first will run and must exit prior to the next, just as though each was on individual lines in a shell script. If the preceding command fails the next will NOT run.