How to read and follow log files
Follow logs live and search history with tail -f, journalctl, less and PowerShell Get-Content -Wait, including filtering by time and service.
Beginner · about 5 min · Linux, Windows, macOS
Logs answer most production questions, but only if you can watch them live and filter history quickly. Three tools cover almost everything: tail for files, journalctl for systemd services, and grep for narrowing.
What this guide covers
- Watch a log as it is written
- Follow and filter at the same time
- Read a systemd service log
- Look at a specific time window
- Page through a large log
- Windows: follow a file live
Common pitfalls covered
- After log rotation, … keeps reading the old file — use … to follow by name.
- Piping a live log into a pager without buffering flags makes output appear stuck.
- Grepping a multi-gigabyte log from the start is slow; narrow by time with journalctl or start from the tail.
Questions answered
- What is the difference between tail -f and tail -F?
- Where are Linux logs stored?
- How do I see only errors from the last hour?
This is a limited preview. The full walkthrough, command syntax and copy-ready examples are available to signed-in users.