Files and folders

The touch command

Creates an empty file or updates its modification date.

Syntax

touch <archivo>...

Most useful options

-cDoes not create the file if it does not exist

Copy-ready examples

$ touch notas.txtCreate an empty file
$ touch a.txt b.txt c.txtSeveral at once

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • If the file exists it does not erase it: it only updates the date.

Related commands

FAQ

Does touch erase content if the file exists?

No: it only updates the date. It is safe.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course