6.1 Directory and File Management Using the Command Line
6.1.8 Creating files
As with directories, files are created by administrators and users. Many applications also create files. Every time you create a new word processing document or spreadsheet, you are creating a new file and should adhere to the file naming conventions previously mentioned. You must also have adequate permissions for the directory in which you are working to create files.

The touch Command
You can create new, empty files using the
touch command. If you list these files using the ls -l command (long listing), you will see that they exist but are zero (0) bytes in length. Using the touch command , you can create one or multiple files simultaneously. Some applications require files to exist before they can be written. The touch command is useful for quickly creating files to experiment with. You can also use the touch command to update the time and date that a file is accessed and this will reset the archive bit making the file available for backup again. Absolute and relative pathnames can be specified when creating files or directories. The Figure shows the use of the touch command to create multiple files.

Command Format:
touch filename(s)

Note: The touch command creates an empty file if the file name specified does not exist. Otherwise, the access/modification time of the existing file is updated.