-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux touch Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to touch on Linux, covering Arch Linux, CachyOS, and other distributions including creating files, updating timestamps, and file management.
touch creates empty files or updates timestamps.
Uses:
- Create files: Make empty files
- Update timestamps: Change file times
- File management: Manage file times
- Scripts: Create files in scripts
Why it matters:
- File creation: Quick file creation
- Timestamp management: Update file times
- Scripting: Useful in automation
Basic usage:
# Create empty file
touch file.txt
# Create multiple files
touch file1.txt file2.txt file3.txtUpdate time:
# Update timestamp
touch existing-file.txt
# Updates access and modification timeCreate in location:
# Create with path
touch /path/to/file.txt
# Creates file at pathCreate several:
# Create multiple
touch file{1..10}.txt
# Creates file1.txt through file10.txtCustom timestamp:
# Set specific time
touch -t 202401151200 file.txt
# Format: YYYYMMDDHHMMMatch another file:
# Match reference file
touch -r reference.txt file.txt
# Copies timestamp from referenceFix permissions:
# Check directory permissions
ls -ld /path/to/directory
# Use sudo if needed
sudo touch /path/to/file.txtThis guide covered touch usage, file creation, and timestamp management for Arch Linux, CachyOS, and other distributions.
- ls Guide - List files
- File Management - Filesystem management
-
touch Documentation:
man touch
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.