O'Reilly logo

Practical Linux by Bill Ball, John Ray, Michael Turner, M. Drew Streib

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 Files and Directories

Creating files and directories is an integral part of organizing your data while using Linux. The following sections show you how to create files and directories, so you can later copy, move, and organize your information.

Using touch to Create and Update Files and Directories

The touch command is used to create or update files and directories. Use touch with a new filename to create a file, or use an existing filename to update the file's access and modification times. For example, the following command line uses touch to create three files:

$ touch file1 file2 file3

Use ls -l to check the modification time of a file, like this:

$ ls -l *.txt
-rw-rw-r--  1 michael   users   12 Jan 25 12:38 friends.txt

In 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