touch (command)
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, touch is a
command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
used to update the access date and/or modification date of a
computer file A computer file is a computer resource for recording data in a computer storage device, primarily identified by its file name. Just as words can be written to paper, so can data be written to a computer file. Files can be shared with and trans ...
or directory. It is included in
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, an ...
and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s,
TSC TSC may refer to: Organizations * Technology Service Corporation, a US engineering company * Terrorist Screening Center, a division of the National Security Branch of the US Federal Bureau of Investigation * The Shopping Channel, a Canadian televi ...
's FLEX,
Digital Research Digital Research, Inc. (DR or DRI) was a company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser DOS, DOS Plus, DR DOS and Gr ...
/ Novell
DR DOS DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
, the
AROS Aros may refer to: *Aros (Middle-earth), a river in J. R. R. Tolkien's Middle-earth legendarium * Aros, Mull, the location of Aros Castle, a ruined 13th-century castle on the Isle of Mull, Scotland *AROS Research Operating System, a free software i ...
shell, the
Microware Microware Systems Corporation was an American software company based in Clive, Iowa, that produced the OS-9 real-time operating system. Microware Systems Corporation existed as a separate entity from 1977 until September 2001, when it was bought ...
OS-9 OS-9 is a family of real-time, process-based, multitasking, multi-user operating systems, developed in the 1980s, originally by Microware Systems Corporation for the Motorola 6809 microprocessor. It was purchased by Radisys Corp in 2001, an ...
shell, and ReactOS. The command is also available for
FreeDOS FreeDOS (formerly Free-DOS and PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running legacy software and supporting embedded systems. FreeDOS can ...
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 Make or MAKE may refer to: * Make (magazine), a tech DIY periodical *Make (software), a software build tool *Make, Botswana, in the Kalahari Desert *Make Architects Make Architects is an international architecture practice headquartered in Londo ...
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 The history of Unix dates back to the mid-1960s, when the Massachusetts Institute of Technology, AT&T Bell Labs, and General Electric were jointly developing an experimental time-sharing operating system called Multics for the GE-645 mainframe. M ...
. Today, the command is available for a number of different operating systems, including many
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, an ...
and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems,
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
, Microsoft Windows and the classic Mac OS. The version of touch bundled in
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
coreutils The GNU Core Utilities or coreutils is a package of GNU software containing implementations for many of the basic tools, such as cat, ls, and rm, which are used on Unix-like operating systems. In September 2002, the ''GNU coreutils'' were cr ...
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 of the
UnxUtils UnxUtils is a collection of ports of common GNU Unix-like utilities to native Win32, with executables only depending on the Microsoft C- runtime msvcrt.dll. The collection was last updated externally on April 15, 2003, by Karl M. Syring. The mo ...
collection of native
Win32 The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
ports A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as H ...
of common GNU Unix-like utilities. The
FreeDOS FreeDOS (formerly Free-DOS and PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running legacy software and supporting embedded systems. FreeDOS can ...
version was developed by Kris Heidenstrom and is licensed under the
GPL The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general u ...
.
DR DOS 6.0 DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
DR DOS 6.0 User Guide Optimisation and Configuration Tips
/ref> and
KolibriOS KolibriOS, or Kolibri, is a small, open-source x86 operating system written completely in assembly. It was forked from MenuetOS in 2004 and has run under independent development since. In a 2009 review piece on alternative operating systems, ...
include an implementation of the command. The command has also been ported to the IBM i operating system.


See also

*
System time In computer science and computer programming, system time represents a computer system's notion of the passage of time. In this sense, ''time'' also includes the passing of days on the calendar. System time is measured by a ''system clock'', w ...
*
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of G ...


References


Further reading

*


External links

* * * *
examples showing how to use touch
{{Use dmy dates, date=March 2014 Standard Unix programs Unix SUS2008 utilities Plan 9 commands Inferno (operating system) commands ReactOS commands IBM i Qshell commands