{"id":5681,"date":"2022-12-20T18:57:25","date_gmt":"2022-12-20T21:57:25","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/touch-man1p\/"},"modified":"2022-12-20T18:57:25","modified_gmt":"2022-12-20T21:57:25","slug":"touch-man1p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/touch-man1p\/","title":{"rendered":"TOUCH (man1p)"},"content":{"rendered":"<h1 align=\"center\">TOUCH<\/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\">touch \u2014 change file access and modification times<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">touch <b>[<\/b>-acm<b>] [<\/b>-r <i>ref_file<\/i>|-t <i>time<\/i>|-d <i>date_time<\/i><b>]<\/b> <i>file<\/i>&#8230;<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>touch<\/i> utility shall change the last data modification timestamps, the last data access timestamps, or both.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The time used can be specified by the <b>\u2212t<\/b> <i>time<\/i> option-argument, the corresponding <i>time<\/i> fields of the file referenced by the <b>\u2212r<\/b> <i>ref_file<\/i> option-argument, or the <b>\u2212d<\/b> <i>date_time<\/i> option-argument, as specified in the following sections. If none of these are specified, <i>touch<\/i> shall use the current time.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For each <i>file<\/i> operand, <i>touch<\/i> shall perform actions equivalent to the following functions defined in the System Interfaces volume of POSIX.1-2017:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p>1.<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"35%\">\n<p>If <i>file<\/i> does not exist:<\/p>\n<\/td>\n<td width=\"48%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\">a.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"23%\"><\/td>\n<td width=\"77%\">\n<p style=\"margin-top: 1em\">The <i>creat<\/i>() function is called with the following arguments:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%;\">&#8212;<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"8%\"><\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\">\n<p style=\"margin-top: 1em\">The <i>file<\/i> operand is used as the <i>path<\/i> argument.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"8%\">\n<p>&#8212;<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\">\n<p>The value of the bitwise-inclusive OR of S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH is used as the <i>mode<\/i> argument.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"8%\">\n<p>b.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">The <i>futimens<\/i>() function is called with the following arguments:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"14%\">\n<p style=\"margin-top: 1em\">&#8212;<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\">\n<p style=\"margin-top: 1em\">The file descriptor opened in step 1a.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"14%\">\n<p>&#8212;<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\">\n<p>The access time and the modification time, set as described in the OPTIONS section, are used as the first and second elements of the <i>times<\/i> array argument, respectively.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"14%\">\n<p>2.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"71%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If <i>file<\/i> exists, the <i>utimensat<\/i>() function is called with the following arguments:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"4%\">\n<p style=\"margin-top: 1em\">a.<\/p>\n<\/td>\n<td width=\"1%\"><\/td>\n<td width=\"77%\">\n<p style=\"margin-top: 1em\">The AT_FDCWD special value is used as the <i>fd<\/i> argument.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"4%\">\n<p>b.<\/p>\n<\/td>\n<td width=\"1%\"><\/td>\n<td width=\"77%\">\n<p>The <i>file<\/i> operand is used as the <i>path<\/i> argument.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"4%\">\n<p>c.<\/p>\n<\/td>\n<td width=\"1%\"><\/td>\n<td width=\"77%\">\n<p>The access time and the modification time, set as described in the OPTIONS section, are used as the first and second elements of the <i>times<\/i> array argument, respectively.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"18%\"><\/td>\n<td width=\"4%\">\n<p>d.<\/p>\n<\/td>\n<td width=\"1%\"><\/td>\n<td width=\"77%\">\n<p>The <i>flag<\/i> argument is set to zero.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>touch<\/i> utility shall conform to the Base Definitions volume of POSIX.1-2017, <i>Section 12.2<\/i>, <i>Utility Syntax Guidelines<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following options 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=\"3%\">\n<p style=\"margin-top: 1em\"><b>\u2212a<\/b><\/p>\n<\/td>\n<td width=\"12%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">Change the access time of <i>file<\/i>. Do not change the modification time unless <b>\u2212m<\/b> is also specified.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212c<\/b><\/p>\n<\/td>\n<td width=\"12%\"><\/td>\n<td width=\"74%\">\n<p>Do not create a specified <i>file<\/i> if it does not exist. Do not write any diagnostic messages concerning this condition.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212d\u00a0<\/b><i>date_time<\/i><\/p>\n<p style=\"margin-left:26%;\">Use the specified <i>date_time<\/i> instead of the current time. The option-argument shall be a string of the form:<\/p>\n<p style=\"margin-left:32%; margin-top: 1em\"><i>YYYY<\/i>&#8211;<i>MM<\/i>&#8211;<i>DD<\/i>T<i>hh<\/i>:<i>mm<\/i>:<i>SS<\/i><b>[<\/b>.<i>frac<\/i><b>][<\/b><i>tz<\/i><b>]<\/b><\/p>\n<p style=\"margin-left:26%; margin-top: 1em\">or:<\/p>\n<p style=\"margin-left:32%; margin-top: 1em\"><i>YYYY<\/i>&#8211;<i>MM<\/i>&#8211;<i>DD<\/i>T<i>hh<\/i>:<i>mm<\/i>:<i>SS<\/i><b>[<\/b>,<i>frac<\/i><b>][<\/b><i>tz<\/i><b>]<\/b><\/p>\n<p style=\"margin-left:26%; margin-top: 1em\">where:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"28%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"68%\">\n<p><i>YYYY<\/i> are at least four decimal digits giving the year.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"28%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"68%\">\n<p><i>MM<\/i>, <i>DD<\/i>, <i>hh<\/i>, <i>mm<\/i>, and <i>SS<\/i> are as with <b>\u2212t<\/b> <i>time<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"28%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"68%\">\n<p>T is the time designator, and can be replaced by a single <space>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"28%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"68%\">\n<p>[.<i>frac<\/i>] and [,<i>frac<\/i>] are either empty, or a <period> (<b>\u2019.\u2019<\/b>) or a <comma> (<b>\u2019,\u2019<\/b>) respectively, followed by one or more decimal digits, specifying a fractional second.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"28%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"68%\">\n<p>[<i>tz<\/i>] is either empty, signifying local time, or the letter <b>\u2019Z\u2019<\/b>, signifying UTC. If [<i>tz<\/i>] is empty, the resulting time shall be affected by the value of the <i>TZ<\/i> environment variable.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:26%; margin-top: 1em\">If the resulting time precedes the Epoch, the behavior is implementation-defined. If the time cannot be represented as the file\u2019s timestamp, <i>touch<\/i> shall exit immediately with an error status.<\/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=\"3%\">\n<p style=\"margin-top: 1em\"><b>\u2212m<\/b><\/p>\n<\/td>\n<td width=\"12%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">Change the modification time of <i>file<\/i>. Do not change the access time unless <b>\u2212a<\/b> is also specified.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212r\u00a0<\/b><i>ref_file<\/i><\/p>\n<p style=\"margin-left:26%;\">Use the corresponding time of the file named by the pathname <i>ref_file<\/i> instead of the current time.<\/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><b>\u2212t\u00a0<\/b><i>time<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Use the specified <i>time<\/i> instead of the current time. The option-argument shall be a decimal number of the form:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:32%; margin-top: 1em\"><b>[[<\/b><i>CC<\/i><b>]<\/b><i>YY<\/i><b>]<\/b><i>MMDDhhmm<\/i><b>[<\/b>.<i>SS<\/i><b>]<\/b><\/p>\n<p style=\"margin-left:26%; margin-top: 1em\">where each two digits represents the following:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><i>MM<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p style=\"margin-top: 1em\">The month of the year [01,12].<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>DD<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The day of the month [01,31].<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>hh<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The hour of the day [00,23].<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>mm<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The minute of the hour [00,59].<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>CC<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The first two digits of the year (the century).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>YY<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The second two digits of the year.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"3%\">\n<p><i>SS<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"62%\">\n<p>The second of the minute [00,60].<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:26%; margin-top: 1em\">Both <i>CC<\/i> and <i>YY<\/i> shall be optional. If neither is given, the current year shall be assumed. If <i>YY<\/i> is specified, but <i>CC<\/i> is not, <i>CC<\/i> shall be derived as follows:<\/p>\n<p align=\"center\" style=\"margin-top: 1em\"><img decoding=\"async\" src=\"grohtml-894771.png\" alt=\"Image grohtml-894771.png\"><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"26%\"><\/td>\n<td width=\"8%\">\n<p style=\"margin-top: 1em\"><b>Note:<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"58%\">\n<p style=\"margin-top: 1em\">It is expected that in a future version of this standard the default century inferred from a 2-digit year will change. (This would apply to all commands accepting a 2-digit year as input.)<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:26%; margin-top: 1em\">The resulting time shall be affected by the value of the <i>TZ<\/i> environment variable. If the resulting time value precedes the Epoch, the behavior is implementation-defined. If the time is out of range for the file\u2019s timestamp, <i>touch<\/i> shall exit immediately with an error status. The range of valid times past the Epoch is implementation-defined, but it shall extend to at least the time 0 hours, 0 minutes, 0 seconds, January 1, 2038, Coordinated Universal Time. Some implementations may not be able to represent dates beyond January 18, 2038, because they use <b>signed int<\/b> as a time holder.<\/p>\n<p style=\"margin-left:26%; margin-top: 1em\">The range for <i>SS<\/i> is [00,60] rather than [00,59] because of leap seconds. If <i>SS<\/i> is 60, and the resulting time, as affected by the <i>TZ<\/i> environment variable, does not refer to a leap second, the resulting time shall be one second after a time where <i>SS<\/i> is 59. If <i>SS<\/i> is not given a value, it is assumed to be zero.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If neither the <b>\u2212a<\/b> nor <b>\u2212m<\/b> options were specified, <i>touch<\/i> shall behave as if both the <b>\u2212a<\/b> and <b>\u2212m<\/b> options were specified.<\/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=\"6%\">\n<p style=\"margin-top: 1em\"><i>file<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">A pathname of a file whose times shall be modified.<\/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>touch<\/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>LANG<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">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>TZ<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Determine the timezone to be used for interpreting the <i>time<\/i> option-argument. If <i>TZ<\/i> is unset or null, an unspecified default timezone shall be used.<\/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\">Default.<\/p>\n<h2>STDOUT <a name=\"STDOUT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Not used.<\/p>\n<h2>STDERR <a name=\"STDERR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The standard error shall be used only for diagnostic messages.<\/p>\n<h2>OUTPUT FILES <a name=\"OUTPUT FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/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=\"3%\">\n<p style=\"margin-top: 1em\">0<\/p>\n<\/td>\n<td width=\"6%\"><\/td>\n<td width=\"80%\">\n<p style=\"margin-top: 1em\">The utility executed successfully and all requested changes were made.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>>0<\/p>\n<\/td>\n<td width=\"6%\"><\/td>\n<td width=\"80%\">\n<p>An error occurred.<\/p>\n<\/td>\n<\/tr>\n<\/table>\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 interpretation of time is taken to be <i>seconds since the Epoch<\/i> (see the Base Definitions volume of POSIX.1-2017, <i>Section 4.16<\/i>, <i>Seconds Since the Epoch<\/i>). It should be noted that implementations conforming to the System Interfaces volume of POSIX.1-2017 do not take leap seconds into account when computing seconds since the Epoch. When <i>SS<\/i>=60 is used, the resulting time always refers to 1 plus <i>seconds since the Epoch<\/i> for a time when <i>SS<\/i>=59.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Although the <b>\u2212t<\/b> <i>time<\/i> option-argument specifies values in 1969, the access time and modification time fields are defined in terms of seconds since the Epoch (00:00:00 on 1 January 1970 UTC). Therefore, depending on the value of <i>TZ<\/i> when <i>touch<\/i> is run, there is never more than a few valid hours in 1969 and there need not be any valid times in 1969.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>T<\/i> time designator is replaced by a <space> for the <b>\u2212d<\/b> <i>date_time<\/i> option-argument, the <space> must be quoted to prevent the shell from splitting the argument.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>dwc<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 local time:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -d 2007-11-12T10:15:30 dwc<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>nick<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 UTC:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -d 2007-11-12T10:15:30Z nick<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>gwc<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 local time with a fractional second timestamp of .002 seconds:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -d 2007-11-12T10:15:30,002 gwc<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>ajosey<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 UTC with a fractional second timestamp of .002 seconds:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -d &#8220;2007-11-12 10:15:30.002Z&#8221; ajosey<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>cathy<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:00 local time:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -t 200711121015 cathy<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>drepper<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 local time:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -t 200711121015.30 drepper<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>ebb9<\/b>; the resulting file has both the last data modification and last data access timestamps set to November 12, 2007 at 10:15:30 local time:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -t 0711121015.30 ebb9<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create or update a file called <b>eggert<\/b>; the resulting file has the last data access timestamp set to the corresponding time of the file named <b>mark<\/b> instead of the current time. If the file exists, the last data modification time is not changed:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">touch -a -r mark eggert<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The functionality of <i>touch<\/i> is described almost entirely through references to functions in the System Interfaces volume of POSIX.1-2017. In this way, there is no duplication of effort required for describing such side-effects as the relationship of user IDs to the user database, permissions, and so on.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">There are some significant differences between the <i>touch<\/i> utility in this volume of POSIX.1-2017 and those in System V and BSD systems. They are upwards-compatible for historical applications from both implementations:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\">1.<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">In System V, an ambiguity exists when a pathname that is a decimal number leads the operands; it is treated as a time value. In BSD, no <i>time<\/i> value is allowed; files may only be <i>touch<\/i>ed to the current time. The <b>\u2212t<\/b> <i>time<\/i> construct solves these problems for future conforming applications (note that the <b>\u2212t<\/b> option is not historical practice).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p>2.<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p>The inclusion of the century digits, <i>CC<\/i>, is also new. Note that a ten-digit <i>time<\/i> value is treated as if <i>YY<\/i>, and not <i>CC<\/i>, were specified. The caveat about the range of dates following the Epoch was included as recognition that some implementations are not able to represent dates beyond 18 January 2038 because they use <b>signed int<\/b> as a time holder.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>\u2212r<\/b> option was added because several comments requested this capability. This option was named <b>\u2212f<\/b> in an early proposal, but was changed because the <b>\u2212f<\/b> option is used in the BSD version of <i>touch<\/i> with a different meaning.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">At least one historical implementation of <i>touch<\/i> incremented the exit code if <b>\u2212c<\/b> was specified and the file did not exist. This volume of POSIX.1-2017 requires exit status zero if no errors occur.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In previous version of the standard, if at least two operands are specified, and the first operand is an eight or ten-digit decimal integer, the first operand was assumed to be a <i>date_time<\/i> operand. This usage was removed in this version of the standard since it had been marked obsolescent previously.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>\u2212d<\/b> <i>date_time<\/i> format is an ISO\u00a08601:2004 standard complete representation of date and time extended format with an optional decimal point or <comma> followed by a string of digits following the seconds portion to specify fractions of a second. It is not necessary to recognize <b>&#8220;[+\/-]hh:mm&#8221;<\/b> and <b>&#8220;[+\/-]hh&#8221;<\/b> to specify timezones other than local time and UTC. The <i>T<\/i> time designator in the ISO\u00a08601:2004 standard extended format may be replaced by <space>.<\/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>date<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The Base Definitions volume of POSIX.1-2017, <i>Section 4.16<\/i>, <i>Seconds Since the Epoch<\/i>, <i>Chapter 8<\/i>, <i>Environment Variables<\/i>, <i>Section 12.2<\/i>, <i>Utility Syntax Guidelines<\/i>, <b><sys_stat.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The System Interfaces volume of POSIX.1-2017, <i>creat<\/i>(), <i>futimens<\/i>(), <i>time<\/i>(), <i>utime<\/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>  touch \u2014 change file access and modification times <\/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,2512],"class_list":["post-5681","post","type-post","status-publish","format-standard","hentry","category-1p-posix-comandos-generales","category-sin-categoria","tag-man1p","tag-touch"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5681","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=5681"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5681\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}