cat: the whole file
cat prints a file from top to bottom. It's perfect for short files:
cat recipes/pancakes.txtcat -n numbers the lines. Give cat several files and it prints them one after another (its name comes from concatenate).
head: the beginning
For a long file, you rarely want all of it. head prints the first 10 lines; -n picks how many:
head poem.txthead -n 2 poem.txttail: the end
tail prints the last 10 lines. Programs add new lines to the end of their log files, so tail is how you see what happened most recently:
tail logs/app.logtail -n 3 logs/app.logtail -n +5 does the opposite of what you might guess: it prints everything from line 5 onwards. On a real server, tail -f keeps the file open and prints new lines as they arrive.
To scroll through a long file on a real system, use less (press q to quit). This practice terminal doesn't have it: use head and tail.