O'Reilly logo

Ubuntu Unleashed 2013 Edition: Covering 12.10 and 13.04, Eighth Edition by Matthew Helmke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a File with touch

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 12, “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 directory, I can use the following: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required