$touch
Create empty files or update file access and modification timestamps.
touch [OPTIONS] FILE...Try `touch` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
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 / Option | Description |
|---|---|
| -a | Change only the access time. |
| -m | Change only the modification time. |
| -c | Do not create any files if they do not already exist. |
Practical Real-World Examples
touch server.js config.json .env && ls -lCreates three empty files in the current folder.
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.
Related Linux Commands
Search for files and directories in a directory hierarchy based on name, type, size, or modification date.
Concatenate and print file contents directly to the terminal standard output.
Create new directories and folder hierarchies.
Remove files or directories from the filesystem.
Copy files and directories to a destination path.
Move or rename files and directories.