|
|
||
|
||
|
|
| Red Hat Documentation: man pages: man1: User Commands (1) |
TOUCHSection: User Commands (1)Updated: August 1998 Index NAMEtouch - change file timestampsSYNOPSIStouch [-acm][-r ref_file|-t time] file...
Obsolescent version:
GNU version:
DESCRIPTIONtouch changes the access and/or modification timestamps of each specified file. These timestamps are changed to the current time, unless the -r option is specified, in which case they are changed to the corresponding timestamps of the file ref_file, or the -t option is specified, in which case they are changed to the specified time. Both times are changed when neither or both of the -a and -m options are given. Only the access or only the modification time is changed when one of the options -a and -m is given. If the file did not exist yet, it is created (as an empty file with mode 0666, modified by the umask), unless the -c option is given.POSIX OPTIONS
POSIX DETAILSThe second form of invocation has the disadvantage that there is some ambiguity as to whether ugly_time is a time or a file argument. It is taken to be a time when no -r or -t option is present, there are at least two arguments, and the first argument is an eight- or ten-digit decimal integer. The format of ugly_time is MMDDhhmm[yy], where an yy in the range 69-99 denotes a year in the range 1969-1999, and an unspecified yy denotes the current year. This form is obsolete.GNU DETAILSIf the first file would be a valid argument to the -t option and no timestamp is given with any of the -d, -r or -t options and the `--' argument is not given, that argument is interpreted as the time for the other files instead of as a file name.If changing both the access and modification times to the current time, touch can change the timestamps for files that the user running it does not own but has write permission for. Otherwise, the user must own the files. GNU OPTIONS
GNU STANDARD OPTIONS
ENVIRONMENTThe variable TZ is used to interpret explicitly given times. The variables LANG, LC_ALL, LC_CTYPE and LC_MESSAGES have the usual meaning.CONFORMING TOPOSIX 1003.2 describes a syntax for the argument of the -t option that differs from that used by the GNU implementation.EXAMPLE OF USEThe command `touch foo' will create the file foo if it didn't exist, and change the time of last modification to now. It is often used to guide the actions of make.NOTESThis page describes touch as found in the fileutils-3.16 package; other versions may differ slightly. Mail corrections and additions to aeb@cwi.nl and aw@mail1.bet1.puv.fi and ragnar@lightside.ddns.org . Report bugs in the program to fileutils-bugs@gnu.ai.mit.edu.
Index
This document was created by using the manual pages. Time: 11:46:34 GMT, March 24, 2025 |
|
|