logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

touch.1.in (1710B)


  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 achm
  13. .Op Fl d Ar isotime | Fl t Ar datetime | 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. .Bl -tag -width Ds
  21. .It Fl a
  22. Change the access time, no changes to modification time unless
  23. .Fl m
  24. is also given.
  25. .It Fl c
  26. Do not create
  27. .Ar file .
  28. .It Fl d Ar isotime
  29. include(lib/iso_parse.mdoc)
  30. .It Fl h
  31. Do not follow symlinks.
  32. .It Fl m
  33. Change the modification time, no changes to access time unless
  34. .Fl a
  35. is also given.
  36. .It Fl t Ar datetime
  37. Use the specified
  38. .Ar datetime
  39. instead of the current time, with the form
  40. .Oo Oo CC Oc Ns YY Oc Ns MMDDhhmm Ns Oo \.SS Oc
  41. where:
  42. .Bl -tag -width _MMDDhhmm_
  43. .It Ql CC
  44. Corresponds to the first 2 digits of the year, aka %C
  45. .It Ql YY
  46. Corresponds to the last 2 digits of the year, aka %y
  47. .It Ql MMDDhhmm
  48. Corresponds to month, day, hours, minutes aka %m%d%H%M
  49. .It Ql .SS
  50. Corresponds to the seconds
  51. .El
  52. .Pp
  53. For example:
  54. .Ql 200306021337.42
  55. .It Fl r Ar ref_file
  56. Use the corresponding times of the file at
  57. .Ar ref_file
  58. instead of the current time.
  59. .El
  60. .Sh EXIT STATUS
  61. .Ex -std
  62. Note: Will exit with failure when
  63. .Fl c
  64. is given but the file doesn't exists.
  65. .Sh SEE ALSO
  66. .Xr stat 1 ,
  67. .Xr futimens 3 ,
  68. .Xr strptime 3
  69. .Sh STANDARDS
  70. .Nm
  71. should be compliant with the
  72. IEEE Std 1003.1-2024 (“POSIX.1”)
  73. specification.
  74. .Pp
  75. .Fl h
  76. is an extension.
  77. .Sh AUTHORS
  78. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me