A terminal log viewer for files bigger than your RAM, with vi's keys.
Open a 100 GB log on a machine with 10 GB and it starts instantly and stays small: memory depends on your terminal size, not on the file.
- Huge files, flat memory. Indexing runs in the background; the first screen appears at once.
- vi keys.
j/k,/,n,gg/G, counts, visual mode — and every key can be rebound. - Filters that stack. Show only what matches, hide what doesn't, highlight the rest; save the set and reuse it on the next incident.
- Knows log formats. Kernel, syslog, JSON and ISO-timestamped logs are recognised from their content and coloured; add your own in a few lines.
- Follows and pages.
tail -ffor growing files and pipes, and a drop-in$PAGERforgit logand friends.
Linux, macOS, FreeBSD, OpenBSD and Windows.
go install github.com/sidcha/log-viewer/cmd/lv@latestOr download a binary from the releases page,
run it with nix run github:sidcha/log-viewer or add it to a Nix config
(see Nix), or build from source with make build (see
development).
lv /var/log/syslog # open a file
lv -f /var/log/kern.log # follow it, like tail -f
journalctl -f | lv -f # follow a pipe
git log | lv # use it as a pager
lv -o ERROR -N healthcheck app.log # only ERROR lines, never healthcheck
lv -r incident.json app.log # reuse rules saved earlier
lv -r api.rules api.log worker.log # several files; ] and [ switchInside lv:
| Key | Does |
|---|---|
j k gg G |
move down, up, to the top, to the end |
C-d C-u Space |
half page down / up, page down |
/ ? n N |
search forward, back, next, previous |
f |
fuzzy-find a line and jump to it |
& ! m |
show only / never show / highlight matching lines |
= |
list, edit and toggle your rules |
\ |
turn every rule off for a moment |
F |
follow the end of the file |
: |
command line (:42, :set wrap, :w out.log) |
F1 |
help |
q |
quit |
These are defaults — see key bindings for the full map and how to change any of it.
- Key bindings — every key, and how to rebind them
- Rules — filtering, highlighting, saving and reusing rules
- Configuration — settings, config files, colours
- Syntax highlighting — log formats and your own profiles
- tmux, pipes and paging — captures,
$PAGER, tmux - Nix — the flake, its overlay, and adding lv to a NixOS or home-manager config
- Internals — how it stays small, with measurements
- Development — building, testing and releasing
Apache-2.0. See LICENSE.