logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

touch.1 (3375B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2023-06-03
  5. .Dt TOUCH 1
  6. .Os
  7. .Sh NAME
  8. .Nm touch
  9. .Nd change file access and modification times
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl acfhm
  13. .Op Fl d Ar datetime | Fl t Ar timestamp | Fl r Ar ref_file
  14. .Ar file...
  15. .Sh DESCRIPTION
  16. .Nm
  17. changes the date modification and access times on each
  18. .Ar file
  19. it is given.
  20. .Sh OPTIONS
  21. .Bl -tag -width Ds
  22. .It Fl a
  23. Change the access time, no changes to modification time unless
  24. .Fl m
  25. is also given.
  26. .It Fl c
  27. Do not create
  28. .Ar file .
  29. .It Fl f
  30. Ignored.
  31. coreutils and BusyBox never supported it,
  32. .Ox
  33. removed it in 2005,
  34. .Nx
  35. in 2011,
  36. .Fx
  37. in 2012.
  38. .\" Let's not publicly document too much that illumos still supports it
  39. .It Fl d Ar datetime
  40. Use
  41. .Ar datetime
  42. instead of current time, see
  43. .Sx DATETIME FORMAT
  44. section for more details.
  45. .It Fl h
  46. Do not follow symlinks.
  47. .It Fl m
  48. Change the modification time, no changes to access time unless
  49. .Fl a
  50. is also given.
  51. .It Fl t Ar timestamp
  52. Use the specified
  53. .Ar timestamp
  54. instead of the current time, with the form
  55. .Oo Oo CC Oc Ns YY Oc Ns MMDDhhmm Ns Oo \.SS Oc
  56. where:
  57. .Bl -tag -width _MMDDhhmm_
  58. .It Ql CC
  59. Corresponds to the first 2 digits of the year, aka %C
  60. .It Ql YY
  61. Corresponds to the last 2 digits of the year, aka %y
  62. .It Ql MMDDhhmm
  63. Corresponds to month, day, hours, minutes aka %m%d%H%M
  64. .It Ql .SS
  65. Corresponds to the seconds
  66. .El
  67. .Pp
  68. For example:
  69. .Ql 200306021337.42
  70. .It Fl r Ar ref_file
  71. Use the corresponding times of the file at
  72. .Ar ref_file
  73. instead of the current time.
  74. .El
  75. .Sh DATETIME FORMAT
  76. .\" utils-std: Collection of commonly available Unix tools
  77. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  78. .\" SPDX-License-Identifier: MPL-2.0
  79. .\"
  80. Multiple different but unambiguous formats are supported:
  81. @epoch, Email, asctime, RFC3339.
  82. .Ss @epoch
  83. Leading @ (at) symbol followed by
  84. the Unix timestamp (number of seconds before and after 1970-01-01 00:00:00Z),
  85. for example
  86. .Ql @1698791420
  87. corresponds to 2023-10-31 23:30:20 UTC
  88. .Ss Email
  89. Also known as "Internet Message Format" (RFC5322, RFC2822, RFC822), for example:
  90. .Bl -bullet -compact
  91. .It
  92. .Ql Fri, 21 Nov 1997 09:55:06 -0600
  93. .It
  94. .Ql 21 Nov 97 09:55:06 GMT
  95. .El
  96. .Ss asctime
  97. Output format of
  98. .Xr asctime 3 ,
  99. for example:
  100. .Ql Sun Sep 16 01:03:52 1973
  101. .Ss RFC3339
  102. Profile of ISO\ 8601:1988, found in modern protocols and file formats.
  103. Formatted as
  104. .Ql YYYY-MM-DDThh:mm:SS[frac][tz] ,
  105. where:
  106. .Bl -tag -width Ds
  107. .It Ql YYYY-MM-DD
  108. Corresponds to %Y-%m-%d of
  109. .Xr strptime 3 .
  110. .It Ql T
  111. Is either
  112. .Ql T
  113. or a space.
  114. .It Ql [frac]
  115. Is either empty, or fractional seconds starting with either a comma
  116. .Pq \&,
  117. or a period
  118. .Pq \&. .
  119. .It Ql [tz]
  120. When empty it corresponds to local time.
  121. Otherwise it can be an UTC offset in the format
  122. .Ql [+-]HH:?MM
  123. or the letter
  124. .Qq Z ,
  125. signifying UTC.
  126. .El
  127. .Pp
  128. Some examples:
  129. .Bl -bullet -compact
  130. .It
  131. .Ql 2003-06-02T13:37:42.713Z
  132. .It
  133. .Ql 1971-01-02T03:04:05.678+0900
  134. .El
  135. .Sh EXIT STATUS
  136. .Ex -std
  137. Note: Will exit with failure when
  138. .Fl c
  139. is given but the file doesn't exists.
  140. .Sh SEE ALSO
  141. .Xr stat 1 ,
  142. .Xr futimens 3 ,
  143. .Xr strptime 3
  144. .Sh STANDARDS
  145. .Nm
  146. should be compliant with the
  147. IEEE Std 1003.1-2024 (“POSIX.1”)
  148. specification.
  149. .Pp
  150. .Fl h
  151. and
  152. .Fl f
  153. are extensions.
  154. .Sh AUTHORS
  155. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me