Search⌘ K
AI Features

Creating Files

Explore the use of the touch command to create empty files and update file timestamps on the command line. Learn to create single or multiple files simultaneously and place them anywhere on your filesystem, enhancing your ability to manage files through CLI.

We'll cover the following...

In Creating and Reading Files, we 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.

The touch command

If we only need to create an empty file, we can use the touch command. This command is designed to update the timestamp of a file. It’s ...