{"id":6100,"date":"2022-12-20T18:57:55","date_gmt":"2022-12-20T21:57:55","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/nohup-man1p\/"},"modified":"2022-12-20T18:57:55","modified_gmt":"2022-12-20T21:57:55","slug":"nohup-man1p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/nohup-man1p\/","title":{"rendered":"NOHUP (man1p)"},"content":{"rendered":"<h1 align=\"center\">NOHUP<\/h1>\n<p> <a href=\"#PROLOG\">PROLOG<\/a><br \/> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#OPERANDS\">OPERANDS<\/a><br \/> <a href=\"#STDIN\">STDIN<\/a><br \/> <a href=\"#INPUT FILES\">INPUT FILES<\/a><br \/> <a href=\"#ENVIRONMENT VARIABLES\">ENVIRONMENT VARIABLES<\/a><br \/> <a href=\"#ASYNCHRONOUS EVENTS\">ASYNCHRONOUS EVENTS<\/a><br \/> <a href=\"#STDOUT\">STDOUT<\/a><br \/> <a href=\"#STDERR\">STDERR<\/a><br \/> <a href=\"#OUTPUT FILES\">OUTPUT FILES<\/a><br \/> <a href=\"#EXTENDED DESCRIPTION\">EXTENDED DESCRIPTION<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#CONSEQUENCES OF ERRORS\">CONSEQUENCES OF ERRORS<\/a><br \/> <a href=\"#APPLICATION USAGE\">APPLICATION USAGE<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#RATIONALE\">RATIONALE<\/a><br \/> <a href=\"#FUTURE DIRECTIONS\">FUTURE DIRECTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a> <\/p>\n<hr>\n<h2>PROLOG <a name=\"PROLOG\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page is part of the POSIX Programmer\u2019s Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">nohup \u2014 invoke a utility immune to hangups<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">nohup <i>utility<\/i> <b>[<\/b><i>argument<\/i>&#8230;<b>]<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>nohup<\/i> utility shall invoke the utility named by the <i>utility<\/i> operand with arguments supplied as the <i>argument<\/i> operands. At the time the named <i>utility<\/i> is invoked, the SIGHUP signal shall be set to be ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If standard input is associated with a terminal, the <i>nohup<\/i> utility may redirect standard input from an unspecified file.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the standard output is a terminal, all output written by the named <i>utility<\/i> to its standard output shall be appended to the end of the file <b>nohup.out<\/b> in the current directory. If <b>nohup.out<\/b> cannot be created or opened for appending, the output shall be appended to the end of the file <b>nohup.out<\/b> in the directory specified by the <i>HOME<\/i> environment variable. If neither file can be created or opened for appending, <i>utility<\/i> shall not be invoked. If a file is created, the file\u2019s permission bits shall be set to S_IRUSR | S_IWUSR.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If standard error is a terminal and standard output is open but is not a terminal, all output written by the named utility to its standard error shall be redirected to the same open file description as the standard output. If standard error is a terminal and standard output either is a terminal or is closed, the same output shall instead be appended to the end of the <b>nohup.out<\/b> file as described above.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>OPERANDS <a name=\"OPERANDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following operands shall be supported:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>utility<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>The name of a utility that is to be invoked. If the <i>utility<\/i> operand names any of the special built-in utilities in <i>Section 2.14<\/i>, <i>Special Built-In Utilities<\/i>, the results are undefined.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>argument<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Any string to be supplied as an argument when invoking the utility named by the <i>utility<\/i> operand.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>STDIN <a name=\"STDIN\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Not used.<\/p>\n<h2>INPUT FILES <a name=\"INPUT FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>ENVIRONMENT VARIABLES <a name=\"ENVIRONMENT VARIABLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following environment variables shall affect the execution of <i>nohup<\/i>:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p style=\"margin-top: 1em\"><i>HOME<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">Determine the pathname of the user\u2019s home directory: if the output file <b>nohup.out<\/b> cannot be created in the current directory, the <i>nohup<\/i> utility shall use the directory named by <i>HOME<\/i> to create the file.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LANG<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1-2017, <i>Section 8.2<\/i>, <i>Internationalization Variables<\/i> for the precedence of internationalization variables used to determine the values of locale categories.)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LC_ALL<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>If set to a non-empty string value, override the values of all the other internationalization variables.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LC_CTYPE<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><i>LC_MESSAGES<\/i><\/p>\n<p style=\"margin-left:26%;\">Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><i>NLSPATH<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Determine the location of message catalogs for the processing of <i>LC_MESSAGES<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><i>PATH<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Determine the search path that is used to locate the utility to be invoked. See the Base Definitions volume of POSIX.1-2017, <i>Chapter 8<\/i>, <i>Environment Variables<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>ASYNCHRONOUS EVENTS <a name=\"ASYNCHRONOUS EVENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>nohup<\/i> utility shall take the standard action for all signals except that SIGHUP shall be ignored.<\/p>\n<h2>STDOUT <a name=\"STDOUT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If the standard output is not a terminal, the standard output of <i>nohup<\/i> shall be the standard output generated by the execution of the <i>utility<\/i> specified by the operands. Otherwise, nothing shall be written to the standard output.<\/p>\n<h2>STDERR <a name=\"STDERR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If the standard output is a terminal, a message shall be written to the standard error, indicating the name of the file to which the output is being appended. The name of the file shall be either <b>nohup.out<\/b> or <b>$HOME\/nohup.out<\/b>.<\/p>\n<h2>OUTPUT FILES <a name=\"OUTPUT FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Output written by the named utility is appended to the file <b>nohup.out<\/b> (or <b>$HOME\/nohup.out<\/b>), if the conditions hold as described in the DESCRIPTION.<\/p>\n<h2>EXTENDED DESCRIPTION <a name=\"EXTENDED DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following exit values shall be returned:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p style=\"margin-top: 1em\">126<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"77%\">\n<p style=\"margin-top: 1em\">The utility specified by <i>utility<\/i> was found but could not be invoked.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p>127<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"77%\">\n<p>An error occurred in the <i>nohup<\/i> utility or the utility specified by <i>utility<\/i> could not be found.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">Otherwise, the exit status of <i>nohup<\/i> shall be that of the utility specified by the <i>utility<\/i> operand.<\/p>\n<h2>CONSEQUENCES OF ERRORS <a name=\"CONSEQUENCES OF ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>The following sections are informative.<\/i><\/p>\n<h2>APPLICATION USAGE <a name=\"APPLICATION USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>command<\/i>, <i>env<\/i>, <i>nice<\/i>, <i>nohup<\/i>, <i>time<\/i>, and <i>xargs<\/i> utilities have been specified to use exit code 127 if an error occurs so that applications can distinguish \u2018\u2018failure to find a utility\u2019\u2019 from \u2018\u2018invoked utility exited with an error indication\u2019\u2019. The value 127 was chosen because it is not commonly used for other meanings; most utilities use small values for \u2018\u2018normal error conditions\u2019\u2019 and the values above 128 can be confused with termination due to receipt of a signal. The value 126 was chosen in a similar manner to indicate that the utility could be found, but not invoked. Some scripts produce meaningful error messages differentiating the 126 and 127 cases. The distinction between exit codes 126 and 127 is based on KornShell practice that uses 127 when all attempts to <i>exec<\/i> the utility fail with <b>[ENOENT]<\/b>, and uses 126 when any attempt to <i>exec<\/i> the utility fails for any other reason.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">It is frequently desirable to apply <i>nohup<\/i> to pipelines or lists of commands. This can be done by placing pipelines and command lists in a single file; this file can then be invoked as a utility, and the <i>nohup<\/i> applies to everything in the file.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Alternatively, the following command can be used to apply <i>nohup<\/i> to a complex command:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">nohup sh -c &#8216;<i>complex-command-line<\/i>&#8216; <\/dev\/null<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The 4.3 BSD version ignores SIGTERM and SIGHUP, and if <b>.\/nohup.out<\/b> cannot be used, it fails instead of trying to use <b>$HOME\/nohup.out<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>csh<\/i> utility has a built-in version of <i>nohup<\/i> that acts differently from the <i>nohup<\/i> defined in this volume of POSIX.1-2017.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The term <i>utility<\/i> is used, rather than <i>command<\/i>, to highlight the fact that shell compound commands, pipelines, special built-ins, and so on, cannot be used directly. However, <i>utility<\/i> includes user application programs and shell scripts, not just the standard utilities.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Historical versions of the <i>nohup<\/i> utility use default file creation semantics. Some more recent versions use the permissions specified here as an added security precaution.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Some historical implementations ignore SIGQUIT in addition to SIGHUP; others ignore SIGTERM. An early proposal allowed, but did not require, SIGQUIT to be ignored. Several reviewers objected that <i>nohup<\/i> should only modify the handling of SIGHUP as required by this volume of POSIX.1-2017.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Historical versions of <i>nohup<\/i> did not affect standard input, but that causes problems in the common scenario where the user logs into a system, types the command:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">nohup make &#038;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">at the prompt, and then logs out. If standard input is not affected by <i>nohup<\/i>, the login session may not terminate for quite some time, since standard input remains open until <i>make<\/i> exits. To avoid this problem, POSIX.1-2008 allows implementations to redirect standard input if it is a terminal. Since the behavior is implementation-defined, portable applications that may run into the problem should redirect standard input themselves. For example, instead of:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">nohup make &#038;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">an application can invoke:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">nohup make <\/dev\/null &#038;<\/p>\n<h2>FUTURE DIRECTIONS <a name=\"FUTURE DIRECTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Chapter 2<\/i>, <i>Shell Command Language<\/i>, <i>sh<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The Base Definitions volume of POSIX.1-2017, <i>Chapter 8<\/i>, <i>Environment Variables<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The System Interfaces volume of POSIX.1-2017, <i>signal<\/i>()<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology &#8212; Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http:\/\/www.opengroup.org\/unix\/online.html .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https:\/\/www.kernel.org\/doc\/man-pages\/reporting_bugs.html .<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  nohup \u2014 invoke a utility immune to hangups <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3782,1],"tags":[2511,2769],"class_list":["post-6100","post","type-post","status-publish","format-standard","hentry","category-1p-posix-comandos-generales","category-sin-categoria","tag-man1p","tag-nohup"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6100"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6100\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}