Frequent Question: What Touch Command Do in Linux?

Frequent Question: What Touch Command Do in Linux?
Contents

The touch command is a standard command used in UNIX/Linux operating system which is used to create, change and modify timestamps of a file.

What does the touch command do to a file?

touch avoids opening, saving, and closing the file. Instead it simply updates the dates associated with the file or directory. An updated access or modification date can be important for a variety of other programs such as backup utilities or the make command-line interface programming utility.

What is touch command in Unix examples?

10 practical examples of Touch command on Linux

  • Create a blank file. …
  • Create multiple files with touch. …
  • Create lots and lots of files. …
  • Avoid creating new files. …
  • Change file access time – ‘a’ …
  • Change the modified time ‘-m’ …
  • Change access and modification time together. …
  • Set a specific access/modify time instead of current time.
Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.