Online Linux Terminal Logo
OnlineLinuxTerminal
File OperationsCLI Reference

$touch

Create empty files or update file access and modification timestamps.

Syntax DefinitionPOSIX standard
touch [OPTIONS] FILE...
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `touch` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How touch Works

`touch` is the standard tool for quickly creating empty placeholder files or updating the access and modification timestamps of existing files to the current system time.

Common Flags & Command Options

Flag / OptionDescription
-aChange only the access time.
-mChange only the modification time.
-cDo not create any files if they do not already exist.

Practical Real-World Examples

Example #1Create multiple new empty files
touch server.js config.json .env && ls -l

Creates three empty files in the current folder.

Sample Output:
-rw-r--r-- 1 user user 0B server.js -rw-r--r-- 1 user user 0B config.json -rw-r--r-- 1 user user 0B .env

Frequently Asked Questions

What happens if you touch an existing file?

Touching an existing file will NOT alter or erase its content; it only updates its last-accessed and last-modified timestamps.