touch command in Linux with Examples

touch command means Change file timestamps. The touch command in Linux is used to create empty files or update the timestamp of existing files.

touch command in Linux with Examples


touch [OPTION]… FILE…

On the man page, the describes it

  • touch – change file timestamps.
  • man touch – More details information about touch command.

touch command in Linux with Examples

Create a new file:

$ touch devopsroles.txt

Create multiple files at once:

touch file1.txt file2.txt file3.txt

Set a specific timestamp:

touch -t 202306151200.00 filename.txt

Create a new file with specific permissions:

touch -m 644 filename.txt

Update the timestamp of a file

touch filename.txt


touch command in Linux is a simple command in Linux. It is the most popular in-use terminal Linux change file timestamps.

You can find more options and details on the touch command’s manual page by running man touch in the terminal. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

1 thought on “touch command in Linux with Examples

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.