Jump to content

Touch (command): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
mNo edit summary
Citation bot (talk | contribs)
Removed parameters. | Use this bot. Report bugs. | #UCB_CommandLine
 
(23 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Short description|File modification command on various operating systems}}
{{lowercase}}
{{lowercase}}
{{Infobox software
{{Infobox software
| name = touch
| name = touch
| logo =
| logo =
| screenshot =
| screenshot = Touch-example.png
| screenshot size =
| screenshot size =
| caption =
| caption = Example of <code>touch</code> usage
| author = [[AT&T Bell Laboratories]]
| 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
| developer = Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, [[Technical Systems Consultants|TSC]], [[Microware]], [[Apple Inc.|Apple]], [[Digital Research]], [[Novell]], Kris Heidenstrom
Line 11: Line 12:
| latest release version =
| latest release version =
| latest release date =
| 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]]
| 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]]
| platform = [[Cross-platform]]
| genre = [[Command (computing)|Command]]
| genre = [[Command (computing)|Command]]
| license = [[coreutils]]: [[GPLv3+]]<br />
| 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]]
[[FreeDOS]]: [[GPLv2]]
| website =
| website =
}}
}}
In [[computing]], '''<code>touch</code>''' is a [[command (computing)|command]] used to update the access date and/or modification date of a [[computer file]] or [[directory (computing)|directory]]. It is included in [[Unix]] and [[Unix-like]] [[operating system]]s, [[Technical Systems Consultants|TSC]]'s [[FLEX (operating system)|FLEX]],<ref>[http://www.flexusergroup.com/flexusergroup/pdfs/swflexum.pdf FLEX 9.0 User’s Manual]</ref> [[Digital Research]]/[[Novell]] [[DR DOS]], the [[AROS Research Operating System|AROS]] shell,<ref>[http://aros.sourceforge.net/documentation/users/shell/index.php AROS Research Operating System]</ref> the [[Microware]] [[OS-9]] shell,<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> and [[ReactOS]].<ref>https://github.com/reactos/reactos/blob/master/modules/rosapps/applications/cmdutils/touch/touch.c</ref>
In [[computing]], '''<code>touch</code>''' is a [[command (computing)|command]] used to update the access date and/or modification date of a [[computer file]] or [[directory (computing)|directory]]. It is included in [[Unix]] and [[Unix-like]] [[operating system]]s, [[Technical Systems Consultants|TSC]]'s [[FLEX (operating system)|FLEX]],<ref>{{Cite web|url=http://www.flexusergroup.com/flexusergroup/pdfs/swflexum.pdf|title=FLEX 9.0 User's Manual}}</ref> [[Digital Research]]/[[Novell]] [[DR DOS]], the [[AROS Research Operating System|AROS]] shell,<ref>{{Cite web|url=https://aros.sourceforge.io/documentation/users/shell/index.php|title=AROS Research Operating System|website=aros.sourceforge.io}}</ref> the [[Microware]] [[OS-9]] shell,<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> and [[ReactOS]].<ref>{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub}}</ref>
The command is also available for [[FreeDOS]]<ref>http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/group-util.html</ref> and [[Microsoft Windows]].<ref>[http://www.binarez.com/touch_dot_exe touch for Windows]</ref>
The command is also available for [[FreeDOS]]<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> and [[Microsoft Windows]].<ref>{{Cite web|url=https://sourceforge.net/projects/touchforwindows/|title=touch for Windows}}</ref>


==Overview==
==Overview==
Line 29: Line 30:
A <code>touch</code> utility first appeared in [[Version 7 Unix|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]].{{which|date=January 2015 <!-- a short list here would be very useful -->}}
A <code>touch</code> utility first appeared in [[Version 7 Unix|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]].{{which|date=January 2015 <!-- a short list here would be very useful -->}}


The version of <code>touch</code> bundled in [[GNU]] [[coreutils]] was written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.<ref>https://linux.die.net/man/1/touch</ref>
The version of <code>touch</code> bundled in [[GNU]] [[coreutils]] 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>


The command is available as a separate package for Microsoft Windows as part the [[UnxUtils]] collection of [[Native (computing)|native]] [[Windows API|Win32]] [[porting|ports]] of common [[GNU]] [[Unix-like]] [[utility|utilities]].<ref>http://unxutils.sourceforge.net/</ref> The [[FreeDOS]] version was developed by Kris Heidenstrom and is licensed under the [[GNU General Public License|GPL]].<ref>http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/touch.html</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> and [[KolibriOS]]<ref>http://wiki.kolibrios.org/wiki/Shell</ref> include an implementation of the {{code|touch}} command. The {{Mono|touch}} command has also been ported to the [[IBM i]] operating system.<ref>{{cite web |title=IBM System i Version 7.2 Programming Qshell |language=en |author=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 |url-status=live}}</ref>
The command is available as a separate package for Microsoft Windows as part of the [[UnxUtils]] collection of [[Native (computing)|native]] [[Windows API|Win32]] [[porting|ports]] of common GNU Unix-like utilities.<ref>{{Cite web|url=http://unxutils.sourceforge.net/|title=Native Win32 ports of some GNU utilities|website=unxutils.sourceforge.net}}</ref> The [[FreeDOS]] version was developed by Kris Heidenstrom and is licensed under the [[GNU General Public License|GPL]].<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> [[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> and [[KolibriOS]]<ref>{{Cite web|url=http://wiki.kolibrios.org/wiki/Shell|title=Shell - KolibriOS wiki|website=wiki.kolibrios.org}}</ref> include an implementation of the {{code|touch}} command. The {{Mono|touch}} command has also been ported to the [[IBM i]] operating system.<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>


==See also==
==See also==
Line 38: Line 39:


==References==
==References==
{{Reflist|2}}
{{Reflist}}


==Further reading==
==Further reading==
Line 52: Line 53:


{{Unix commands}}
{{Unix commands}}
{{Plan 9 commands}}

{{Core Utilities commands}}
{{Use dmy dates|date=March 2014}}
{{Use dmy dates|date=March 2014}}


Line 59: Line 61:
[[Category:Plan 9 commands]]
[[Category:Plan 9 commands]]
[[Category:Inferno (operating system) commands]]
[[Category:Inferno (operating system) commands]]
[[Category:ReactOS commands]]
[[Category:IBM i Qshell commands]]

Latest revision as of 13:15, 27 September 2023

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)
Written inC
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
ReactOS: BSD-4-Clause
BusyBox: GPL-2.0-only
Toybox: 0BSD
Plan 9: MIT License

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,[1] Digital Research/Novell DR DOS, the AROS shell,[2] the Microware OS-9 shell,[3] and ReactOS.[4] The command is also available for FreeDOS[5] and Microsoft Windows.[6]

Overview

[edit]

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

[edit]

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.[which?]

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

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

See also

[edit]

References

[edit]
  1. ^ "FLEX 9.0 User's Manual" (PDF).
  2. ^ "AROS Research Operating System". aros.sourceforge.io.
  3. ^ Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
  4. ^ "reactos/reactos". GitHub.
  5. ^ "ibiblio.org FreeDOS Group -- Utilities". www.ibiblio.org.
  6. ^ "touch for Windows".
  7. ^ "touch(1): change file timestamps - Linux man page". linux.die.net.
  8. ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net.
  9. ^ "ibiblio.org FreeDOS Package -- touch (Unix-like)". www.ibiblio.org.
  10. ^ DR DOS 6.0 User Guide Optimisation and Configuration Tips
  11. ^ "Shell - KolibriOS wiki". wiki.kolibrios.org.
  12. ^ IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). IBM. Retrieved 5 September 2020.

Further reading

[edit]
[edit]