Mission 10

Grep practice

Search literal text in logs and practice case-insensitive matching.

Text and logs
8 minutes Beginner Lesson 10 of 360
grepcat
Lesson 10 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.

Find denied auth

Run grep denied /var/log/auth.log.

grep denied /var/log/auth.log
Search nginx case-insensitively

Run grep -i nginx /var/log/syslog.

grep -i nginx /var/log/syslog
Search config text

Run grep server_name /etc/nginx/sites-available/learn.conf.

grep server_name /etc/nginx/sites-available/learn.conf
Lesson support

What to notice while you play.

Objective

Use grep to isolate relevant log lines.

Hint

Start with grep denied, then try grep -i nginx.

Why it matters

Fast text search is one of the most valuable terminal habits.

Common mistakes
  • Searching the wrong file.
  • Forgetting -i when case might vary.
Reference

Commands in this lesson.

cat <file>

Print text file contents.

grep [-i] <text> <file>

Find literal text inside a file.