The touch command has several options that can modify its behavior. Here are some commonly used options:
-
-a: Change only the access time of the file.touch -a file1.txt -
-m: Change only the modification time of the file.touch -m file1.txt -
-c: Do not create the file if it does not exist.touch -c file1.txt -
-d: Set the file's timestamp to a specific date and time.touch -d "2023-01-01 12:00:00" file1.txt -
-t: Set the file's timestamp using a specific format (e.g.,[[CC]YY]MMDDhhmm[.ss]).touch -t 202301011200.00 file1.txt -
-r: Use the timestamp of another file.touch -r reference.txt file1.txt
These options allow you to customize how touch interacts with files. If you need more details or examples, let me know!
