Saving Output Into a File
Send a command's output into a file instead of the screen.
The > is a redirect: instead of printing to the screen, whatever the command would have said is poured into the file named on the right.
This is the fastest way to make a small file, with no editor involved at all. Nothing appears on screen when you do it, because the words went into the file instead. Use cat to prove they arrived.
Careful with it: > empties the file first, so it replaces whatever was there before. The next lesson shows the safer twin.
echo "text" > file.txtWrite text into a file, replacing it.cat file.txtCheck what landed there.Your task
- ○Write a line into scores.txt with >
- ○Prove it worked with cat
Open this level in your browser to type the commands at a live terminal that answers back.