touch

Linux · Files · available in the simulator

What it does

Change file timestamps or create an empty file.

Syntax

touch [opciones] archivo...

Options and parameters

  • -a

    Change only the access time.

  • -m

    Change only the modification time.

  • -t STAMP

    Use [[CC]YY]MMDDhhmm[.ss] instead of current time

  • -c

    Do not create any files.

    touch -c archivo.txt
  • -t

    Use specified time with the [[CC]YY]MMDDhhmm[.ss] format.

    touch -t 202601011200 archivo.txt
  • -r

    Use this reference file's times instead of current time.

    touch -r modelo.txt destino.txt

Usage examples

  • touch nuevo.txt
  • touch -a archivo
  • touch -t 202601011200 archivo
  • touch notas.txt
  • touch -d '2026-01-01' archivo
  • touch -c archivo.txt
  • touch -t 202601011200 archivo.txt
  • touch -r modelo.txt destino.txt
Practise touch

Related commands