lnav
A terminal log file viewer that merges, indexes, filters and queries log files by time, with SQLite-based analysis.
Tested on Linux
Use it
Linux x86_64
These steps ran from a folder named work in the home folder, which already existed. Make it and run them from there:
mkdir -p "$HOME/work" && cd "$HOME/work"download static linux-musl-x86_64 release zip v0.14.1, unzip, copy lnav to ~/.local/bin
cd /tmp && curl -fsSLO https://github.com/tstack/lnav/releases/download/v0.14.1/lnav-0.14.1-linux-musl-x86_64.zip && rm -rf lnavx && unzip -o -q lnav-0.14.1-linux-musl-x86_64.zip -d lnavx && mkdir -p ~/.local/bin && cp "$(find lnavx -type f -name lnav)" ~/.local/bin/lnav && chmod +x ~/.local/bin/lnav
Verified in pickfit: the commands exactly as its sandbox ran them
For the record only: they name the sandbox's home, /home/sbx.
cd /tmp && curl -fsSLO https://github.com/tstack/lnav/releases/download/v0.14.1/lnav-0.14.1-linux-musl-x86_64.zip && rm -rf lnavx && unzip -o -q lnav-0.14.1-linux-musl-x86_64.zip -d lnavx && mkdir -p ~/.local/bin && cp "$(find lnavx -type f -name lnav)" ~/.local/bin/lnav && chmod +x ~/.local/bin/lnavlnav -Vcd /home/sbx/work && cat > a.log <<'EOF'
Jan 10 10:00:00 hosta app[100]: starting service
Jan 10 10:00:02 hosta app[100]: error: connection refused
Jan 10 10:00:04 hosta app[100]: shutdown complete
EOF
cat > b.log <<'EOF'
Jan 10 10:00:01 hostb db[200]: listening on port 5432
Jan 10 10:00:03 hostb db[200]: error: disk full
Jan 10 10:00:05 hostb db[200]: checkpoint done
EOFcd /home/sbx/work && lnav -n a.log b.logCheck that it works
lnav -VThe output should contain “lnav 0.14.1”.
First thing to try
cd "$HOME"/work && cat > a.log <<'EOF'
Jan 10 10:00:00 hosta app[100]: starting service
Jan 10 10:00:02 hosta app[100]: error: connection refused
Jan 10 10:00:04 hosta app[100]: shutdown complete
EOF
cat > b.log <<'EOF'
Jan 10 10:00:01 hostb db[200]: listening on port 5432
Jan 10 10:00:03 hostb db[200]: error: disk full
Jan 10 10:00:05 hostb db[200]: checkpoint done
EOFcd "$HOME"/work && lnav -n a.log b.logRun lnav <file> with one or more log files to open them in the viewer.
What it does
- Merge log files into one time-ordered viewTested
How to use it
- Run
lnav -n <file1> <file2>to print the lines of both files merged in time order.
- Run
- Jump to the previous or next errorTested
How to use it
- Run
lnav -n -c ':goto 0' -c ':next-mark error' -c ':write-screen-to -' <file1> <file2>to jump from the top to the next error line and print the screen.
- Run
- Filter messages with a regex or SQLiteTested
How to use it
- Run
lnav -n -c ':filter-in <pattern>' <file1> <file2>to show only lines that match the pattern.
- Run
- Analyze log messages with SQL queriesTested
How to use it
- Run
lnav -n -c ';SELECT log_hostname, count(*) AS n FROM syslog_log WHERE log_level = '"'"'error'"'"' GROUP BY log_hostname' <file1> <file2>to count errors per host. - Start the command with
;followed by your SQL query against the log tables.
- Run
How far pickfit got
Linux x86_64
- Installs
- Starts
- 4 of 4 features work
- Works offline
macOS and Windows: the project says it runs there; pickfit hasn’t tried it.
Good for
- view systemd journal logs in a pager
- merge multiple log files into one time-ordered view
- tail log files and follow renames
An alternative to tail, grep and less.
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 15 Nov 2026
- Version lnav 0.14.1
Differences the test machine hit
- README: Build from source: ./configure; make; sudo make install (needs C++ compiler, many libs and cargo/rust)
In the test: The prebuilt static binary from the release page (lnav-0.14.1-linux-musl-x86_64.zip) unzipped into ~/.local/bin works without root or toolchains - README: lnav /path/to/file1 ... opens the TUI
In the test: Without a terminal, -n (headless) with -c commands was used to exercise features non-interactively