Lessons
05Read files
0 of 6 tasks

Lesson 05 · about 10 min · 6 tasks

Read files

Look inside files of any size: from the top, from the bottom, or by the numbers.

step 1 of 7

The whole thing

You’ve met cat: it prints a whole file. Give it more than one file and it prints them one after another, which is the “concatenate” it’s named after.

$ cat notes.txt
Read files with cat.
The start with head.
The end with tail.

cat is perfect for short files. For a file with thousands of lines, it floods the screen, and that’s where the next three commands come in.

Your turn, in the terminal

  • Read notes.txt
mapfolders appear as you explore
/ …
home/ …
you/◂ you are here
nowRead notes.txt
terminal
Practice terminal. Nothing you do here touches your real computer.
Type help to see what it understands.
you@terminal-mastery:~$