touch (update access and modification date)
Sets the access and modification dates for a file to the current date and time. If the file doesn't exist, touch creates an empty file, setting the dates.
Format: touch filelist
Examples: touch report
Opt | What It Does | Examples |
---|---|---|
-a | Update only the access date | touch -a file1.txt |
-c | Don't create a file | touch -c file3 |
-m | Update only the modification date | touch -m file4 |
-r filename | Change date to match filename | touch -r file2 report3 |
Get Spring Into Linux® now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.