lnav Log file navigator
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
lnav <file>
Concepts
- Open files formats auto-detected
- Filter and search / and : prompts
- Mark lines m, tags, comments
- Query with SQL ; prompt
- Export :write-to and friends
Moving around
Jumping by event
Time travel
:goto <time|line#|N%>
:hide-lines-before <date>
:hide-lines-after <date>
lnav -S <time>
Search and filter
:filter-in <regex>
:filter-out <regex>
:delete-filter <regex>
:set-min-log-level <level>
:filter-expr <sql-expr>
:highlight <regex>
:create-named-search <name> <regex>
Marks and notes
:tag <tag>
:comment <text>
:append-to <path>
:pipe-to <shell-cmd>
Views
:switch-to-view <view>
SQL and export
;SELECT * FROM <log-table> LIMIT 10
:summarize <column>
:write-csv-to <path>
:write-json-to <path>
:open <path>
:close <path>
:hide-file <path>
:sh <cmd>Command line
lnav <file> <dir>
lnav -r <dir>
lnav -tlnav -nlnav -c "<command>"
lnav -f <script>
lnav -e "<cmd>"
lnav -Nlnav -qlnav -i <file>
lnav -Clnav -VRecipes
journalctl -f | lnav# then: e to jump to errors, i for a histogram
lnav -n -c ':goto 2026-10-12 14:00' \ -c ';SELECT log_time, log_body FROM all_logs WHERE log_level = "error"' \ -c ':write-csv-to errors.csv' app.log
:filter-in req-4711# m to mark lines, c to copy them# :append-to notes.txt
lnav /var/log/nginx/# f / Shift+f switches between files



