TOUCH(1)

๐Ÿ’… touch(1) โ€” the touch manual, bestie edition

okay so welcome to touch, from the User Commands girlies โœจ this is the one where you gently poke a file and it wakes up with a brand new timestamp. iconic behavior honestly.


๐ŸŒธ NAME

touch โ€” create a file, or change file timestamps. that's it, that's the job ๐ŸŽ€


โœจ SYNOPSIS

touch [OPTION]... FILE...

๐Ÿ’– DESCRIPTION

Bestie. What touch does is it updates the access and modification times of each FILE to the current time. every single one. no cap.

If a FILE argument doesn't exist yet? It gets created empty. cute, right? ๐Ÿฆ‹ except โ€” if you passed -c or -h, it will NOT do that. it simply refuses, respectfully.

And here's a little secret: if a FILE argument is literally the string -, it's handled specially, and it causes touch to change the times of the file associated with standard output. yes fr fr, that's a thing.

Also, important note before we go any further: mandatory arguments to long options are mandatory for short options too. so don't skip 'em ๐Ÿ‘‘

๐ŸŽ€ OPTIONS (they're in this section, iykyk)

  • -a โ€” change only the access time.
  • -c, --no-create โ€” do not create any files. like, at all. zero. none. ๐Ÿ’€
  • -d, --date=STRING โ€” parse STRING and use it instead of the current time.
  • -f โ€” (ignored). yeah it literally does nothing. it's just... there. a decorative queen ๐Ÿ’…
  • -h, --no-dereference โ€” affect each symbolic link itself instead of any file it references; this is useful only on systems that can actually change the timestamps of a symlink.
  • -m โ€” change only the modification time.
  • -r, --reference=FILE โ€” use this file's times instead of the current time. stealing timestamps, we love to see it ๐Ÿ“
  • -t [[CC]YY]MMDDhhmm[.ss] โ€” use the specified time instead of the current time, with a date-time format that differs from -d's.
  • --time=WORD โ€” specify which time to change: access time (-a): 'access', 'atime', 'use'; modification time (-m): 'modify', 'mtime'.
  • --help โ€” display this help and exit. your bestie when you're lost ๐Ÿซถ
  • --version โ€” output version information and exit.

๐ŸŒˆ DATE STRING

The --date=STRING is a mostly free format human readable date string. like, she's flexible. she contains multitudes. for example:

  • "Sun, 29 Feb 2004 16:21:42 -0800"
  • "2004-02-29 16:21:42"
  • or even "next Thursday" ๐Ÿ˜ญ

A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers.

An empty string indicates the beginning of the day. yes, the whole entire beginning of the day. periodt.

The date string format is more complex than is easily documented here โ€” but it is fully described in the info documentation. so go read that if you want the deep lore ๐Ÿ“–


๐Ÿ‘‘ AUTHOR

Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. absolute legends, every one of them ๐Ÿ’œ


๐Ÿ™ˆ REPORTING BUGS

Report bugs to: <bug-coreutils@gnu.org>. Report any translation bugs to: <https://translationproject.org/team/>. GNU coreutils home page: <https://www.gnu.org/software/coreutils/> General help using GNU software: <https://www.gnu.org/gethelp/>


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. like, none. zero. don't come for us ๐Ÿ˜ญ

๐Ÿฆ‹ SEE ALSO


and that's the whole page bestie!! ๐Ÿ’– this was GNU coreutils 9.12, dated September 2026 โ€” so if you're reading this from the future, hi, hope the timestamps are all correct. mwah ๐Ÿ’…โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from