- Published on
Short engineering note
Today I Learnt: Create an empty file with touch
- Authors

- Name
- Mehdi Akiki
Note · Engineering notes
Create an empty file or update the mtime:
touch file.txt
Redirection can also create or truncate a file:
> newfile.txt
Use touch -c file.txt when you only want to update the timestamp if the file already exists.