Learn
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.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.