Skip to main content
⚑ OpenDevDocs
Linux
linuxlinux-commandsReferenceBeginner

Create Empty File & Update Timestamps (touch)

Create new empty files or update last accessed and modified timestamps of existing files using touch.

Verified: 2026-09-30
Tested on:linux Ubuntu 24.04 / Debian 12
Platforms:
linuxmacos
#linux#touch#files#cli

Command

touch filename.txt


Short Description

touch creates a new empty file if the specified file does not exist, or updates the file's access and modification timestamps if it already exists.


Examples

1. Create Empty Files

touch app.js styles.css .env

2. Update Timestamp Without Modifying Contents

touch existing_file.txt

3. Set Specific Timestamp

touch -t 202610011200.00 old_archive.tar.gz

On this page