touch command
The command that creates an empty file if it does not exist, or updates the modification time of one that does.
In more detail
Its real job is setting timestamps; creating a missing file is a side effect people rely on. Touching an existing file never changes its contents.
Example
touch 'my notes.txt'Related terms
- mkdir — The shell command that makes a new directory; with -p it also makes missing parent directories and does not complain if the directory already exists.
- modification time — The date and time a file's contents were last changed, stored with the file and shown by ls -l.
Taught in
- Making, Copying, Moving And Removing — Bash Scripting & Command Line Automation
- The Unquoted Variable: Splitting And Globbing — Bash Scripting & Command Line Automation