Linux touch Command Builder (Create Files & Update Timestamps)
The touch command is used to create empty files or update timestamps in Linux. This interactive touch Command Builder helps you generate precise touch commands.
🚀 What is the touch Command?
The touch command allows you to:
- Create empty files instantly
- Update access and modification times
- Change specific timestamps
- Avoid overwriting existing files
- Reference timestamps from other files
⚙️ Basic Syntax
touch [options] FILE
touch [options] FILE1 FILE2 ...🧠 How to Use This touch Command Builder
This tool helps you:
- Create new files or update existing ones
- Set specific timestamps
- Use timestamps from reference files
- Generate a ready-to-use touch command
Workflow
- Specify file path(s)
- Choose timestamp options (current time, reference file, specific date)
- Choose which timestamps to update (access, modification, both)
- Copy generated command
🔧 Common touch Usage Patterns
Create Empty File
touch newfile.txtCreate Multiple Files
touch file1.txt file2.txt file3.txtCreate File Without Overwriting
touch -c file.txtUpdate Modification Time Only
touch -m file.txtUpdate Access Time Only
touch -a file.txtSet Specific Date/Time
touch -d "2024-01-15 14:30:00" file.txtCopy Timestamp from Another File
touch -r reference.txt file.txtUse Specific Time Format
touch -t 202401151430.00 file.txt🔧 Time Format Reference
-duses date format: "YYYY-MM-DD HH:MM"-tuses format: "[[CC]YY]MMDDhhmm[.ss]"- CC = century (20)
- YY = year (24)
- MM = month (01-12)
- DD = day (01-31)
- hh = hour (00-23)
- mm = minute (00-59)
- ss = second (00-59)
✅ Pro Tips
- Use
-cto avoid creating files (just update timestamps) - Reference-based timestamps are perfect for build systems
- Perfect for creating placeholder files in scripts
- Can make files appear older or newer for testing