Beginner Package: coreutils

touch

Create an empty file, or update a file's timestamp.

Syntax

touch [options] file

Description

touch creates a new, empty file if it doesn't exist, or updates the modification and access timestamps to the current time if it does โ€” often used in scripts to create placeholder files or mark a point in time.

Examples

touch newfile.txt
Create an empty file (or update its timestamp if it exists)
touch -t 202501011200 file.txt
Set a specific modification timestamp
touch file{1..5}.txt
Create several numbered files at once (shell brace expansion)

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux