Mission 5 of 30 · Milestone

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.

30–40 min Week 1 · Terminal basics Ubuntu terminal
Your outcome: You know how to enter and exit full-screen terminal viewers calmly.
Practice inside ~/linux-practice. Check your setup before you begin. Prerequisite: Writing and Reading File Content .

What you’ll practice

  • Navigate less
  • Use head and tail
  • Count lines and words with wc

The mental model

  • less opens a viewer; press q to quit.
  • head shows the beginning; tail shows the end.
  • Ctrl+C stops commands that keep running.

Try it in your terminal

Create a large file

Safe in practice folder

Generates a harmless file for viewing practice.

Run from ~/linux-practice

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

Preview file parts

Safe in practice folder

Shows first lines, last lines, and counts.

Run from ~/linux-practice

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

Open with less

Safe in practice folder

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

Run from ~/linux-practice

less -N large.txt

Put it into practice

  1. Open large.txt with less and search for line 50.
  2. Quit with q.

Check your result

The organized folder matches the milestone layout.

Milestone challenge

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.

Common mistakes

  • You open `less large.txt` and the terminal goes full-screen. You panic because nothing responds to typing. It's not frozen — it's waiting for viewer commands. Press `q` and you're back. Less is patient.
  • A command keeps printing lines and you can't get back to your prompt. Ctrl+C is your escape key. It tells the running program to stop. Use it without guilt on your own practice files.

Check your understanding

Explain these in your own words. If you’re unsure, revisit the examples before moving on.

  1. How do you quit less?
  2. Which command shows the last 10 lines by default?

Your practice, your pace

Loading saved progress…

Discussion

Continue the conversation about this guide. Loading comments connects to GitHub Discussions through giscus.

Open community discussions on GitHub

Check before you copy

This command needs care. Read its context, confirm the target and location, and keep a recovery path.

Copying does not run a command.