terminal.cab

Linux Basics Lesson 16 of 38

guestLevel 1Badges and progress0/100 XP, XP to the next levelStreak0

The 17:45 report

Rescue 80 XP

9 minutes

Learning goals

The log has today's date, the time and the level, each separated by a single space. For the check over both logs, keep in mind that logs/old.log does not exist. On this machine it also does not need sudo; on most real servers, logs under /var/log do.

Steps

Step 1/3: Count the INFO, WARN and ERROR lines of logs/app.log. Show the result, biggest first, and save it in ~/report.txt in the same run.

Rescue 80 XP

17:45, shortly before quitting time. The team lead writes: "How many INFO, WARN and ERROR lines did we have today in logs/app.log? Put the evaluation in the ticket as a file, but tell me the numbers here right now. And clear out your tmp folder before you go." Three small jobs, and a pipe does most of it.

  1. Step 1

    Count the INFO, WARN and ERROR lines of logs/app.log. Show the result, biggest first, and save it in ~/report.txt in the same run.

  2. Step 2

  3. Step 3

Loading terminal …

lerner@web-01: ~bash
lerner@web-01:~$

Esc, then Tab leaves the terminal

Step 1 of 3

Cards

  1. Card 1 of 2

    Tap the card or press Space to turn it over.

  2. Card 2 of 2

    Tap the card or press Space to turn it over.

Cheat sheet

The most important command lines of this module on one A4 page, black and white, to print or keep on your phone.