Skip to content

touch command

Create empty files or update file timestamps.

On this page

Syntax

touch [options] file…

Provided by the coreutils package. Run man touch for the full manual.

Common options

OptionWhat it does
-aChange only the access time
-mChange only the modification time
-cDon't create files that don't exist
-d DATEUse this date instead of now
-r FILECopy the timestamps of FILE

Examples

  1. Create an empty file

    touch notes.txt
  2. Create several files

    touch a.txt b.txt c.txt
  3. Set a specific date

    touch -d "2026-01-01 10:00" file.txt
  4. Copy timestamps from another file

    touch -r original.txt copy.txt
  5. Update the time only if the file exists

    touch -c app.log

← All Linux commands · Suggest a fix

Back to top