To create an empty file called filename within your current directory, use the following command:
matthew@seymour:~$ touch filename
To edit this file, you must use a text editor. Several are discussed in Chapter 13, “Automating Tasks and Shell Scripting.” However, it is sometimes useful to create an empty file as this creates an access record because of the time and date information that is connected to the file. You can also use
touch to update this information, called a timestamp, without otherwise accessing or modifying a file.
You can create a file in a different location by changing what is after
touch. To create a new file in
/home/matthew/randomdirectory, if I am already in my home ...