TOUCH(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ¦‹ TOUCH(1) β€” User Contributed Perl Documentation, bestie edition πŸ¦‹

🌸 NAME 🌸

touch β€” change access and modification times of files

✨ SYNOPSIS ✨

touch [-acm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file...

πŸ’– DESCRIPTION πŸ’–

Okay so touch sets the access and modification timestamps of files. By default, both the access and modification times get set to the current time. And if the files don’t exist yet? If necessary, they will be created. Slay.

touch exits successfully if and only if all timestamps could be set successfully. No half victories, bestie β€” every single timestamp has to work.

πŸŽ€ OPTIONS πŸŽ€

touch accepts the following options:

  • -a β€” set the access time of the specified files only, unless -m is given as well.
  • -c β€” do not create non-existing files. No warning is generated, and it will not influence the exit status.
  • -f β€” this option is ignored, and only recognized for compatibility reasons.
  • -m β€” set the modification time of the specified files only, unless -a is given as well.
  • -r file β€” use the access and modification time of file instead of the current time.
  • -t [[CC]YY]MMDDhhmm[.SS] β€” set the access and modification times to the specified time. If YY is present, but CC is not, then CC is assumed to be 19 if YY is larger than 69, and 20 otherwise. If YY is not present, the current year is assumed.
It should be noted that many systems cannot deal with timestamps before Jan 1, 1970 or after Jan 19, 2038. So like… mind the era, okay? 😭

🌱 ENVIRONMENT 🌱

The working of touch is not influenced by any environment variables. None. Zero. Zilch. Environment stays out of this one’s business.

πŸ’€ BUGS πŸ’€

touch uses Time::Local to translate the time format to epoch seconds

⭐ STANDARDS ⭐

This touch implementation is compatible with the OpenBSD implementation.

πŸ‘‘ AUTHOR πŸ‘‘

The Perl implementation of touch was written by Abigail, perlpowertools@abigail.be.

This program is copyright by Abigail 1999.

This program is free and open software. You may use, copy, modify, distribute and sell this program (and any modified variants) in any way you wish, provided you do not restrict others to do the same.


That’s the whole page, babe. Signing off with perl v5.42.2, dated 2026-02-15 πŸ’–βœ¨

πŸ“¦ where this page comes from