Mission 306

Output capture contract

Print a predictable marker, capture it, and read it back.

Terminal basics
8 minutes Core Lesson 306 of 360
printfteecat
Lesson 306 of 360 0/360 lessons 0/17 missions Terminal basics · 8 minutes
0%
Continue View profile
Ops lab terminal Training lab
New learnerrank 0XP 0%complete
learner@clairos:/home/learner $ Unix ops lab: type a command, press Enter
Instructions 8 minutes

Click any instruction for the command details, the why, and the common mistake to avoid.

Capture a terminal marker

Run printf terminal-ready | tee lab/terminal-ready.txt.

printf terminal-ready | tee lab/terminal-ready.txt
Read the captured marker

Run cat lab/terminal-ready.txt.

cat lab/terminal-ready.txt
Count the captured output

Run wc -l lab/terminal-ready.txt.

wc -l lab/terminal-ready.txt
Lesson support

What to notice while you play.

Objective

Build repeatable confidence with proving where command output was written.

Hint

Start with printf terminal-ready | tee lab/terminal-ready.txt, inspect the result, then continue in order.

Why it matters

Proving where command output was written helps operators explain what they know before they change anything.

Common mistakes
  • Skipping the output that proves proving where command output was written.
  • Changing several things before recording a baseline.
Reference

Commands in this lesson.

printf <text>

Print formatted training text.

cat <file>

Print text file contents.

tee <file>

Write piped text to a lab file and keep it on screen.