Touch (command)
Template:Short description
Template:Lowercase
{{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1
| unknown = Template:Main other
| preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y
| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid
}}Template:Main other
touch
is a shell command that sets the modification timestamp of an existing file to be current Template:Endash 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<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and Touch for Windows.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>), classic Mac OS, DOS, FreeDOS,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> DR DOS 6.0,<ref name="drdos6userguide">DR DOS 6.0 User Guide Optimisation and Configuration Tips</ref> KolibriOS,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> FLEX,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> AROS,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> OS-9,<ref>Template:Cite book</ref> ReactOS,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and IBM i.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The version bundled in GNU Core Utilities was written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
See alsoEdit
ReferencesEdit
Further readingEdit
External linksEdit
Template:Unix commands Template:Plan 9 commands Template:Core Utilities commands Template:Use dmy dates