Touch (command)

File creation and timestamp updating shell command


title: "Touch (command)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["standard-unix-programs", "unix-sus2008-utilities", "plan-9-commands", "inferno-(operating-system)-commands", "reactos-commands", "ibm-i-qshell-commands"] description: "File creation and timestamp updating shell command" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Touch_(command)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary File creation and timestamp updating shell command ::

::data[format=table title="Infobox software"]

FieldValue
nametouch
screenshotTouch-example.png
captionExample of touch usage
authorAT&T Bell Laboratories
developerPaul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, TSC, Microware, Apple, Digital Research, Novell, Kris Heidenstrom
released
programming languageC
operating systemUnix, Unix-like, Plan 9, Inferno, FLEX, OS-9, Classic Mac OS, Windows, DR DOS, AROS, FreeDOS, ReactOS, KolibriOS, IBM i
platformCross-platform
genreCommand
licensecoreutils: GPLv3+
FreeDOS: GPLv2
ReactOS: BSD-4-Clause
BusyBox: GPL-2.0-only
Toybox: 0BSD
Plan 9: MIT License
::

| name = touch | logo = | screenshot = Touch-example.png | screenshot size = | caption = Example of touch usage | author = AT&T Bell Laboratories | developer = Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, TSC, Microware, Apple, Digital Research, Novell, Kris Heidenstrom | released = | latest release version = | latest release date = | programming language = C | operating system = Unix, Unix-like, Plan 9, Inferno, FLEX, OS-9, Classic Mac OS, Windows, DR DOS, AROS, FreeDOS, ReactOS, KolibriOS, IBM i | platform = Cross-platform | genre = Command | license = coreutils: GPLv3+ FreeDOS: GPLv2 ReactOS: BSD-4-Clause BusyBox: GPL-2.0-only Toybox: 0BSD Plan 9: MIT License | website = touch is a shell command that sets the modification timestamp of an existing file to be current which on a Unix-based file system includes special files such as directories. If the input path does not specify an existing file, then it creates a new, regular file at the path.

The Single UNIX Specification (SUS) specifies that touch changes the access or modification timestamps, or both. The file is identified by file system path supplied as the sole argument. If the path does not specify a file, the command creates a file with access and modification timestamps as specified or by default to the current time.

By default (no options specified), touching a file is equivalent to creating it with no content or if it exists, opening and saving it without any content changes to update the modification timestamp to be current. This convenience functionality is useful for a variety of scenarios including build and backup. The tools used in such scenarios typically ignore files that are older than a certain point of time. For example, make ignores a source code file that is older than the object file it is used to create.

The command is often used to create a new file, so that can subsequently open it in an editor or to create a file required by an operation that does not require specific content.

A command first appeared in Version 7 AT&T UNIX. Today, the command is available for many operating systems, including many Unix and Unix-like systems, Windows (via UnxUtils and Touch for Windows.), classic Mac OS, DOS, FreeDOS, DR DOS 6.0, KolibriOS, FLEX, AROS, OS-9, ReactOS, and IBM i. The version bundled in GNU Core Utilities was written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.

References

References

  1. "Native Win32 ports of some GNU utilities".
  2. "touch for Windows".
  3. "ibiblio.org FreeDOS Package -- touch (Unix-like)".
  4. "ibiblio.org FreeDOS Group -- Utilities".
  5. [https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips]
  6. "Shell - KolibriOS wiki".
  7. "FLEX 9.0 User's Manual".
  8. "AROS Research Operating System".
  9. Paul S. Dayan. (1992). "The OS-9 Guru - 1 : The Facts". Galactic Industrial Limited.
  10. "reactos/reactos".
  11. IBM. "IBM System i Version 7.2 Programming Qshell".
  12. "touch(1): change file timestamps - Linux man page".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

standard-unix-programsunix-sus2008-utilitiesplan-9-commandsinferno-(operating-system)-commandsreactos-commandsibm-i-qshell-commands