lnav
Terminal log file viewer that merges, formats, and indexes log files with SQL analysis and real-time monitoring
lnav is a terminal-based log file viewer that automatically detects log formats, decompresses files, and merges multiple log sources into a single chronological view. It can monitor directories for new files, follow file renames, and build indexes of errors and warnings for quick navigation. The tool handles various log formats including JSON lines and can pretty-print structured data.
The TUI interface provides spatial navigation with hotkeys to jump between errors (e/E), search with regular expressions (/), and filter messages using regex or SQLite expressions. Users can view message histograms over time (i), analyze logs with embedded SQLite queries (;), and highlight patterns with the :highlight command. The tool supports real-time tailing and can process compressed log files without manual decompression.
lnav integrates well with systemd-journald through piped input from journalctl, supporting both standard and JSON output formats. It recognizes additional fields like PRIORITY and _SYSTEMD_UNIT when using JSON format. The tool is particularly useful for system administrators, DevOps engineers, and developers who need to correlate events across multiple log sources and perform complex log analysis beyond basic grep and tail functionality.
Installation
# via Homebrew
brew install lnav
# via FreeBSD
pkg install lnav

Alternatives & related tools
csysdig
Linux system visibility tool that captures syscalls and OS events, with container support; csysdig is its curses-based UI.
ncmpcpp
ncurses-based terminal client for MPD (Music Player Daemon) with tag editor, playlist editor, media library, and visualizer, inspired by ncmpc.
btop
Terminal-based system resource monitor showing CPU, memory, disk, network, and process information
bpytop
Terminal-based system resource monitor showing CPU, memory, disk, network and process usage with interactive interface
nvtop
htop-like GPU and accelerator task monitor supporting NVIDIA, AMD, Intel, Apple, and other vendors
add a badge to your README
Maintain lnav? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/lnav?utm_source=badge)<a href="https://www.trmn.sh/tools/lnav?utm_source=badge"><img src="https://www.trmn.sh/badge/lnav.svg" alt="Featured on trmn" height="20"></a>