Misplaced Pages

touch (command)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Ghettoblaster (talk | contribs) at 14:33, 12 September 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 14:33, 12 September 2020 by Ghettoblaster (talk | contribs)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
This article uses bare URLs, which are uninformative and vulnerable to link rot. Please consider converting them to full citations to ensure the article remains verifiable and maintains a consistent citation style. Several templates and tools are available to assist in formatting, such as reFill (documentation) and Citation bot (documentation). (September 2020) (Learn how and when to remove this message)
touch
Original author(s)AT&T Bell Laboratories
Developer(s)Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, TSC, Microware, Apple, Digital Research, Novell, Kris Heidenstrom
Initial releaseJanuary 1979; 45 years ago (1979-01)
Operating systemUnix, Unix-like, Plan 9, Inferno, FLEX, OS-9, Classic Mac OS, Windows, DR DOS, AROS, FreeDOS, ReactOS, KolibriOS, IBM i
PlatformCross-platform
TypeCommand
Licensecoreutils: GPLv3+
FreeDOS: GPLv2

In computing, touch is a command used to update the access date and/or modification date of a computer file or directory. It is included in Unix and Unix-like operating systems, TSC's FLEX, Digital Research/Novell DR DOS, the AROS shell, the Microware OS-9 shell, and ReactOS. The command is also available for FreeDOS and Microsoft Windows.

Overview

In its default usage, it is the equivalent of creating or opening a file and saving it without any change to the file contents. touch avoids opening, saving, and closing the file. Instead it simply updates the dates associated with the file or directory. An updated access or modification date can be important for a variety of other programs such as backup utilities or the make command-line interface programming utility. Typically these types of programs are only concerned with files which have been created or modified after the program was last run. The touch command can also be useful for quickly creating files for programs or scripts that require a file with a specific name to exist for successful operation of the program, but do not require the file to have any specific content.

The Single Unix Specification (SUS) specifies that touch should change the access times, modification times, or both, for a file. The file is identified by a pathname supplied as a single argument. It also specifies that if the file identified does not exist, the file is created and the access and modification times are set as specified. If no new timestamps are specified, touch uses the current time.

History

A touch utility first appeared in Version 7 AT&T UNIX. Today, the command is available for a number of different operating systems, including many Unix and Unix-like systems, DOS, Microsoft Windows and the classic Mac OS.

The version of touch bundled in GNU coreutils was written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.

The command is available as a separate package for Microsoft Windows as part the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. The FreeDOS version was developed by Kris Heidenstrom and is licensed under the GPL. DR DOS 6.0 and KolibriOS include an implementation of the touch command. The touch command has also been ported to the IBM i operating system.

See also

References

  1. FLEX 9.0 User’s Manual
  2. AROS Research Operating System
  3. Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
  4. https://github.com/reactos/reactos/blob/master/modules/rosapps/applications/cmdutils/touch/touch.c
  5. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/group-util.html
  6. touch for Windows
  7. https://linux.die.net/man/1/touch
  8. http://unxutils.sourceforge.net/
  9. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/touch.html
  10. DR DOS 6.0 User Guide Optimisation and Configuration Tips
  11. http://wiki.kolibrios.org/Shell
  12. IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). Retrieved 5 September 2020.{{cite web}}: CS1 maint: url-status (link)

Further reading

External links

Unix command-line interface programs and shell builtins
File system
Processes
User environment
Text processing
Shell builtins
Searching
Documentation
Software development
Miscellaneous

Categories: