Suggested day 520–30 minutesSafe in practice folder Module milestone

Mission 5 of 5

Viewing Larger Files

Turn a deliberately messy folder into a structure another person can understand.

Use pagers and preview tools so big files do not overwhelm your screen.

Outcome: You know how to enter and exit full-screen terminal viewers calmly.

Mental model

Understand what is happening

less opens a viewer; press q to quit.

head shows the beginning; tail shows the end.

Ctrl+C stops commands that keep running.

Guided lab

Work through the mission

1

Create a large file

Safe

Generates a harmless file for viewing practice.

Terminal
cd ~/linux-practice
for i in {1..100}; do echo "This is line number $i"; done > large.txt
2

Preview file parts

Safe

Shows first lines, last lines, and counts.

Terminal
head -n 5 large.txt
tail -n 5 large.txt
wc large.txt
wc -l large.txt
3

Open with less

Safe

Press Space for next page, /pattern to search, and q to quit.

Terminal
less -N large.txt

Checkpoint

Verify the mission

The organized folder matches the milestone layout.

Try it yourself

One step without a recipe

Starting only from your home directory, recreate a small workspace, add a 100-line file, inspect its beginning and end, and prove your final location and file count.

Need a hint?

When `less` opens and your screen changes, you haven't broken anything. It's a viewer, not a trap. Press `q` to quit, `/` to search, and Space to page down. If everything truly freezes, try Ctrl+C — that stops most commands that won't listen.

Explain it back

Before you move on

  • How do you quit less?
  • Which command shows the last 10 lines by default?

Shortcuts:Alt + ← previous lessonAlt + → next lessonAlt + H home? focus search