touch is used to create a file without any content. The file created using touch command is empty. This command can be used when the user doesnโt have data to store at the time of file creation.
How to use touch
# syntaxtouch<FILE>##### create a empty textfiletouchtest.txt##### create multiple empty textfilestouchtest1.txttest2.txttest3.txt##### change access time (this is used to change access time only)touch-afilename.txt##### check whether a file is created or not. If not, then don't create it. This commands avoids creating files if it already exists
touch-cfileName.txt##### update access and modification timetouch-c-d'16 sep'fileName.txt##### change only the modification timetouch-mfileName.txt##### use the timestamp of another file on a file of your choosing (first_file_name.txt will have the time stamp of second_file_name.txt)
touch-rsecond_file_name.txtfirst_file_name.txt##### create a file using a specified timetouch-tYYMMDDHHMMfileName.txt