Linux touch command with examples

In this article, we have explained Linux touch command with examples.

The touch command used to used to create, change and modify timestamps of a file. If a FILENAME does not exist, it is created as an empty file.

If we try to create file with existing file, then it clears the content of file and creates a new file.

Linux touch command Syntax:

touch

Touch command example:

1. Create file file1.txt

touch file1.txt

2. Create multiple files

touch file2.txt file3

3. Assign timestamp of file ‘file1’ to file ‘file3’

touch -r file1.txt file3

Use man touch to get options of touch command.