DEV Community

Discussion on: Linux Basics

Collapse
 
cmuralisree profile image
Chittoji Murali Sree Krishna

touch filename - will create an empty file
touch -a filename - change the access time only
touch -c filename - if the file does not exist, do not create it
touch -d filename - update the access and modification times
touch -m filename - change the modification time only
touch -r - use the access and modification timestamp of file
touch -t - creates a file using a specified time

it creates a file and also can modify the timestamps

Thread Thread
 
shrihankp profile image
Shrihan

Exactly!

Thread Thread
 
cmuralisree profile image
Chittoji Murali Sree Krishna

most of the people will not use these options & they won't bother about timestamps, so I haven't mentioned them previously.