Javatpoint Logo
Javatpoint Logo

Linux touch command

touch command is a way to create empty files (there are some other mehtods also). You can update the modification and access time of each file with the help of touch command.

Syntax:

Example:

TOUCH Command

Look above, we have created two files namely 'myfile1' and 'myfile2' through touch command. To create multiple files just type all the file names with a single touch command followed by enter key. For example, if you would like to create 'myfile1' and 'myfile2' simultaneously, then your command will be:


touch Options

OptionFunction
touch -aTo change file access and modification time.
touch -mIt is used to only modify time of a file.
touch -rTo update time of one file with reference to the other file.
touch -tTo create a file by specifying the time.
touch -cIt does't create n empty file.
Next TopicLinux rm




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA