Coding for All
Level 8: Making a File
Making a File Create a brand new, completely empty file.

touch creates an empty file if that name does not exist yet. Its original job was to update a file's "last changed" time, which is where the odd name comes from, but making empty files is what people actually use it for.

The .txt on the end is just part of the name: a hint to humans (and to programs) that this file holds plain text. The terminal does not care what a file is called.

Run ls -l afterwards and look at the size column: 0 bytes. It really is empty. The next few lessons fill it up.

touch scores.txtMake an empty file called scores.txt.
ls -lCheck its size.
Your task
  • Create an empty file called scores.txt
  • Prove it is empty with ls -l

Open this level in your browser to type the commands at a live terminal that answers back.