Coding for All
Level 8: Making a File
Making a File Create a file without opening an editor at all.

The > redirects the output: instead of appearing on screen, whatever the command would have printed is poured into the file named on the right. ECHO plus > is the quickest way to make a small file with no editor involved.

Nothing appears on screen when you do it, because the words went into the file instead. Careful, though: > wipes the file first if it already exists.

Giving DIR a filename lists just that one file, which is a quick way to check something really exists. Look at the size: eleven letters, a space, and the two invisible characters MS-DOS puts at the end of every line.

ECHO Hello there > HELLO.TXTWrite a line into a new file.
DIR HELLO.TXTCheck that one file.
Your task
  • Make a file called HELLO.TXT with ECHO and >
  • Check it exists with DIR

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