Challenge - 5 Problems
Log Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this command?
You run the command
tail -n 3 /var/log/syslog on a Linux system. What does this command do?Linux CLI
tail -n 3 /var/log/syslogAttempts:
2 left
💡 Hint
Think about what the 'tail' command does with the '-n' option.
✗ Incorrect
The tail command shows the end of a file. The -n 3 option tells it to show the last 3 lines.
💻 Command Output
intermediate1:30remaining
What does this command output?
You run
grep -i error /var/log/auth.log | wc -l. What does this command do?Linux CLI
grep -i error /var/log/auth.log | wc -l
Attempts:
2 left
💡 Hint
Remember what
grep and wc -l do.✗ Incorrect
grep -i error finds lines with 'error' ignoring case. wc -l counts those lines.
🔧 Debug
advanced2:00remaining
Why does this command fail?
You try to run
cat /var/log/secure | grep 'Failed password' but get a permission denied error. Why?Linux CLI
cat /var/log/secure | grep 'Failed password'Attempts:
2 left
💡 Hint
Check file permissions for /var/log/secure.
✗ Incorrect
The /var/log/secure file is usually readable only by root. Without root, you get permission denied.
🚀 Application
advanced2:00remaining
Create a command to monitor new log entries
Which command will continuously show new lines added to /var/log/messages in real time?
Attempts:
2 left
💡 Hint
Think about commands that follow file changes live.
✗ Incorrect
tail -f shows the end of a file and updates as new lines are added.
🧠 Conceptual
expert2:30remaining
What is the purpose of log rotation in /var/log?
Why do Linux systems use log rotation for files in /var/log?
Attempts:
2 left
💡 Hint
Think about disk space and file management.
✗ Incorrect
Log rotation moves or compresses old logs to keep file sizes manageable and save disk space.