new page about the touch command in the filesystem folder

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@267 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
hijmam 2018-11-19 12:29:19 +00:00
parent 4ea37569f5
commit 42af044380
1 changed files with 50 additions and 0 deletions

50
site/pages/fs/touch.html Normal file
View File

@ -0,0 +1,50 @@
---
layout: page
category-page: fs
category-title: FileSystem
tags: directory list remove delete erase
author: Mattia Hijman
title: Touch
previous-page: pages/fs/rm.html
---
<pre>
touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]]
file ...
</pre>
The touch utility sets the modification and access times of files. If any file does not exist, it is created with default permissions.<br>
By default, touch changes both modification and access times. The -a and -m flags may be used to select the access time or the modification time individually. Selecting both is equivalent to the default. By default, the timestamps are set to the current time. The -t flag explicitly specifies a different time, and the -r flag specifies to set the times those of the specified file.
The -A flag adjusts the values by a specified amount.<br>
The following options are available:<br>
<ul>
<li> <b>-A</b>
Adjust the access and modification time stamps for the file by the specified value. This flag is intended for use in modifying files with incorrectly set time stamps.
The -A flag implies the -c flag: if any file specified does not
exist, it will be silently ignored.</li>
<li> <b>-a</b> Change the access time of the file. The modification time of the
file is not changed unless the -m flag is also specified.</li>
<li> <b>-c</b> Do not create the file if it does not exist. The touch utility
does not treat this as an error. No error messages are displayed
and the exit value is not affected.</li>
<li> <b>-f</b> Attempt to force the update, even if the file permissions do not
currently permit it.</li>
<li> <b>-h</b> If the file is a symbolic link, change the times of the link
itself rather than the file that the link points to. Note that
-h implies -c and thus will not create any new files.</li>
<li> <b>-m</b> Change the modification time of the file. The access time of the
file is not changed unless the -a flag is also specified.</li>
<li> <b>-r</b> Use the access and modifications times from the specified file
instead of the current time of day.</li>
<li> <b>-t</b> Change the access and modification times to the specified time
instead of the current time of day.</li>