June 2019
Intermediate to advanced
328 pages
7h 27m
English
In Creating and Reading Files, you learned how to use the echo command and redirection to create files. This is one of many ways to create files on the command line. Let’s look at a few alternatives.
If you only need to create an empty file, you can use the touch command. This command is designed to update the timestamp of a file. It’s common for programs to watch a file for changes and then react to those changes by executing a process. For example, you might have a process that runs tests whenever a file changes, but you don’t actually want to open the file and make a change. You can use touch to modify the file without actually changing the contents. This would then trigger the program or process monitoring the file.
However, ...