Basic CommandsLesson 13Free preview
Bash Timestamp (touch)
This lesson is part of Bash · All levels
Summary
The touch command creates new empty files if the files do not exist, or updates the modification time if the files do exist. It is often used to prepare temporary files when testing scripts and refreshing timestamps. The resulting file doesn't contain any data until you write it in.
Key points
- Touch files make files empty when they don't exist yet.
- The existing files are only updated in time.
- The contents of old files never erased by touch
- c preventing the creation of new files
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.