touch
touch linux command cheatsheet by Thamizhiniyan C S
Last updated
touch linux command cheatsheet by Thamizhiniyan C S
Last updated
Format | Description |
---|---|
Command | Description |
---|---|
-a
change only the access time
-c, --no-create
do not create any files
-d, --date=STRING
parse STRING and use it instead of current time
-f
(ignored)
-h, --no-dereference
affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink)
-m
change only the modification time
-r, --reference=FILE
use this file's times instead of current time
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a: WORD is modify or mtime: equivalent to -m
--help
display this help and exit
--version
output version information and exit
CC
the first two digits for a year
YY
the last two digits for a year
MM
the month
DD
the day
hh
the hour
mm
the minutes
ss
the seconds
To create a emtpy file
To create multiple files at the same time. These files will be empty upon creation.
To create ten files with appended numbering
To create ten files with appended alphabets
To change a file's access time to the current timestamp.
To modify access time explicitly.
To change both modification and access times to the current timestamp.
Checks if a file is created; if not, it doesn’t create it.
Updates both access and modification times.
To change a file's modification time to the current timestamp.
To set modification time explicitly.
Changes the modification date only.
To set a file's timestamp based on another file's timestamp.
Uses the timestamp of another file.
Creates a file with a specified time.
To set a specific timestamp for an existing file.
To modify the timestamp of a symbolic link without affecting the referenced file.