Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Touch (command)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|File creation and timestamp updating shell command}} {{lowercase}} {{Infobox software | name = touch | logo = | screenshot = Touch-example.png | screenshot size = | caption = Example of <code>touch</code> usage | author = [[AT&T Bell Laboratories]] | developer = Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, [[Technical Systems Consultants|TSC]], [[Microware]], [[Apple Inc.|Apple]], [[Digital Research]], [[Novell]], Kris Heidenstrom | released = {{Start date and age|1979|1}} | latest release version = | latest release date = | programming language = [[C (programming language)|C]] | operating system = [[Unix]], [[Unix-like]], [[Plan 9 from Bell Labs|Plan 9]], [[Inferno (operating system)|Inferno]], [[FLEX (operating system)|FLEX]], [[OS-9]], [[Classic Mac OS]], [[Microsoft Windows|Windows]], [[DR DOS]], [[AROS Research Operating System|AROS]], [[FreeDOS]], [[ReactOS]], [[KolibriOS]], [[IBM i]] | platform = [[Cross-platform]] | genre = [[Command (computing)|Command]] | license = [[coreutils]]: [[GPLv3+]]<br />FreeDOS: [[GPLv2]]<br />ReactOS: [[BSD-4-Clause]]<br />[[BusyBox]]: [[GNU General Public License|GPL-2.0-only]]<br />[[Toybox]]: [[BSD licenses|0BSD]]<br />Plan 9: [[MIT License]] | website = }} '''<code>touch</code>''' is a [[shell (computing)|shell]] [[command (computing)|command]] that sets the modification timestamp of an existing [[computer file|file]] to be current {{endash}} which on a [[Unix]]-based [[file system]] includes [[Unix file type|special files]] such as [[directory (computing)|directories]]. If the input [[Path (computing)|path]] does not specify an existing file, then it creates a new, regular file at the path. The [[Single Unix Specification]] (SUS) specifies that <code>touch</code> 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 [[software build|build]] and [[backup]]. The tools used in such scenarios typically ignore files that are older than a certain point of time. For example [[make (software)|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 Unix|Version 7]] [[AT&T UNIX]]. Today, the command is available for many [[operating system]]s, including many [[Unix]] and [[Unix-like]] systems, Windows (via [[UnxUtils]]<ref>{{Cite web|url=http://unxutils.sourceforge.net/|title=Native Win32 ports of some GNU utilities|website=unxutils.sourceforge.net}}</ref> and Touch for Windows.<ref>{{Cite web|url=https://sourceforge.net/projects/touchforwindows/|title=touch for Windows}}</ref>), [[classic Mac OS]], [[DOS]], [[FreeDOS]],<ref>{{Cite web|url=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/touch.html|title=ibiblio.org FreeDOS Package -- touch (Unix-like)|website=www.ibiblio.org}}</ref><ref>{{Cite web|url=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/group-util.html|title=ibiblio.org FreeDOS Group -- Utilities|website=www.ibiblio.org}}</ref> [[DR DOS 6.0]],<ref name="drdos6userguide">[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]</ref> [[KolibriOS]],<ref>{{Cite web|url=http://wiki.kolibrios.org/wiki/Shell|title=Shell - KolibriOS wiki|website=wiki.kolibrios.org}}</ref> [[FLEX (operating system)|FLEX]],<ref>{{Cite web|url=http://www.flexusergroup.com/flexusergroup/pdfs/swflexum.pdf|title=FLEX 9.0 User's Manual}}</ref> [[AROS Research Operating System|AROS]],<ref>{{Cite web|url=https://aros.sourceforge.io/documentation/users/shell/index.php|title=AROS Research Operating System|website=aros.sourceforge.io}}</ref> [[OS-9]],<ref>{{cite book|author=Paul S. Dayan|year=1992|title=The OS-9 Guru - 1 : The Facts|publisher=Galactic Industrial Limited|isbn=0-9519228-0-7}}</ref> [[ReactOS]],<ref>{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub}}</ref> and [[IBM i]].<ref>{{cite web |title=IBM System i Version 7.2 Programming Qshell |language=en |author=IBM |website=[[IBM]] |author-link=IBM |url=https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzahz/rzahzpdf.pdf?view=kc |access-date=2020-09-05 }}</ref> The version bundled in [[GNU Core Utilities]] was written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.<ref>{{Cite web|url=https://linux.die.net/man/1/touch|title=touch(1): change file timestamps - Linux man page|website=linux.die.net}}</ref> ==See also== * [[System time]] * [[List of POSIX commands]] ==References== {{Reflist}} ==Further reading== *{{Cite book|author-last=McElhearn|author-first=Kirk|title=The Mac OS X Command Line: Unix Under the Hood|date=2006|publisher=[[John Wiley & Sons]]|isbn=978-0470113851}} ==External links== {{Wikibooks|Guide to Unix|Commands}} * {{man|cu|touch|SUS}} * {{man|1|touch|die.net}} * {{man|1|touch|Plan 9}} * {{man|1|touch|Inferno}} * [http://www.linfo.org/touch.html examples showing how to use touch] {{Unix commands}} {{Plan 9 commands}} {{Core Utilities commands}} {{Use dmy dates|date=March 2014}} [[Category:Standard Unix programs]] [[Category:Unix SUS2008 utilities]] [[Category:Plan 9 commands]] [[Category:Inferno (operating system) commands]] [[Category:ReactOS commands]] [[Category:IBM i Qshell commands]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Core Utilities commands
(
edit
)
Template:Endash
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase
(
edit
)
Template:Main other
(
edit
)
Template:Man
(
edit
)
Template:Plan 9 commands
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Unix commands
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Wikibooks
(
edit
)