Learn
Navigation
touch

Now we know how to create directories through the command line, but how do we create new files?

We can do this using the command touch:

$ touch keyboard.txt

The touch command creates a new file inside the working directory. It takes in a filename as an argument and then creates an empty file with that name in the current working directory.

Here we used touch to create a new file named keyboard.txt.

Instructions

1.

List your working directory’s current contents.

2.

Create a new file named keyboard.txt inside the working directory. If you list its contents again, you should now see your file listed.

Folder Icon

Sign up to start coding

Already have an account?