Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

touch

v(uutils coreutils) 0.8.0
touch [OPTION]... [FICHIER]...

Mettre à jour les temps d’accès et de modification de chaque FICHIER avec l’heure actuelle.

Options

--help

Afficher les informations d’aide.

-a

changer seulement le temps d’accès

-t <STAMP>

utiliser [[CC]AA]MMJJhhmm[.ss] au lieu de l’heure actuelle

--date=<STRING>, -d <STRING>

analyser l’argument et l’utiliser au lieu de l’heure actuelle

-f

(ignored)

-m

changer seulement le temps de modification

--no-create, -c

ne créer aucun fichier

--no-dereference, -h

affecter chaque lien symbolique au lieu de tout fichier référencé (seulement pour les systèmes qui peuvent changer les horodatages d’un lien symbolique)

--reference=<FILE>, -r <FILE>

utiliser les temps de ce fichier au lieu de l’heure actuelle

--time=<WORD>

changer seulement le temps spécifié : “access”, “atime”, ou “use” sont équivalents à -a ; “modify” ou “mtime” sont équivalents à -m

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

Create specific files:

touch {{path/to/file1 path/to/file2 ...}}

Set the file [a]ccess or [m]odification times to the current one and don’t create file if it doesn’t exist:

touch {{[-c|--no-create]}} {{-a|-m}} {{path/to/file1 path/to/file2 ...}}

Set the file [t]ime to a specific value and don’t create file if it doesn’t exist:

touch {{[-c|--no-create]}} -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}

Set the files’ timestamp to the reference file’s timestamp, and do not create the file if it does not exist:

touch {{[-c|--no-create]}} {{[-r|--reference]}} {{path/to/reference_file}} {{path/to/file1 path/to/file2 ...}}

Set the timestamp by parsing a string:

touch {{[-d|--date]}} "{{last year|5 hours|next thursday|nov 14|...}}" {{path/to/file}}

Create multiple files with an increasing number:

touch {{path/to/file{1..10}}}

Create multiple files with a letter range:

touch {{path/to/file{a..z}}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.