WeCodeAcademy

Reading and Writing Files

echo prints text. Add > file to write it into a file. cat shows a file.

Examplebash
Open in editor »
/ $
Quick check

Which command shows the contents of a file?

Your turn: write the code

Create a folder docs, put a file docs/a.txt containing the word hello inside it, then print the file's contents. (Bash exercises are checked on the output of your last command.)

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.