theshell.ch/site/pages/fs/touch.html
bevilj 8378ae0a4e interm, fs: fix new added pages
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@279 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-19 14:57:49 +00:00

41 lines
1.3 KiB
HTML

---
layout: page
category-page: fs
category-title: FileSystem
tags: directory list create new file
author: Mattia Hijman
title: touch
previous-page: pages/fs/rm.html
---
The <code>touch</code> command updates the modification and access time of the a file.
If the given file does not exists, it gets created.<br>
<pre>
touch [flags] [file1] [file2] ...
</pre>
<h3>Flags</h3>
<ul>
<li><b>-A</b>: adjust the access and modification timestamps for the file by the
specified value.
</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.</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.
</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>-t</b>: Change the access and modification times to the specified time
instead of the current time of day.
</li>
</ul>