Skip to content

The touch command

Create empty files, or update a file’s time. Creates each file that doesn’t exist yet, empty. For a file that exists, it only updates the modification time; the contents stay as they are.

Usage

touch FILE...

Examples

  • touch todo.txtAn empty file
  • touch a.txt b.txt c.txtThree at once

Learn it step by step

learner@sandbox: ~bash (practice)
Note: Try touch here: your home directory has sample files. Press Try beside an example, or type your own.

A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.