Mission 47

Paging logs

Use less, head, and tail to read logs in chunks.

Text and logs
8 minutes Core Lesson 47 of 360
lessheadtail
Lesson 47 of 360 0/360 lessons 0/17 missions Text and logs · 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.

Page auth log

Run less /var/log/auth.log.

less /var/log/auth.log
Read first lines

Run head -n 2 /var/log/auth.log.

head -n 2 /var/log/auth.log
Read last lines

Run tail -n 2 /var/log/auth.log.

tail -n 2 /var/log/auth.log
Lesson support

What to notice while you play.

Objective

Practice safe log reading without editing files.

Hint

Use less first, then head and tail.

Why it matters

Operators often need a quick view without opening an editor.

Common mistakes
  • Reading only the first line.
  • Assuming the newest event is at the top.
Reference

Commands in this lesson.

less <file>

Page through a file.

head|tail [-n N] <file>

Read the beginning or end of a file.