Linux Text Processing Cheat Sheet/Follow a log in real time

Watch new lines as they are appended.

Section: Line Selection and Context

Follow a log in real time

bash
bash
tail -f /var/log/nginx/access.log
Explanation

Use `-f` to stream appended data in real time.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Line Selection and Context
Show last 50 lines
Read the end of a file.
OpenIn sheetbashsame section
Show first 20 lines
Preview the top of a file.
OpenIn sheetbashsame section
Print a specific line range
Extract lines 100 through 120.
OpenIn sheetbashsame section
Print line range with awk
Alternative line-range extraction using NR.
OpenIn sheetbashsame section
Pipe file content into grep
Basic pipeline for filtering text from a file.
Squeeze repeated spaces
Collapse multiple spaces into one.