LNAV(1)
π LNAV(1) β the log file viewer for the terminal, bestie edition π
okay so. this is lnav(1), from the General Commands Manual, and it is genuinely one of the most underrated little tools in your whole terminal. like, no cap. let's get into it π«Ά
β¨ NAME β¨
lnav β a log file viewer for the terminal. that's the whole vibe. a log viewer. for your terminal. iconic.
πΈ SYNOPSIS πΈ
lnav [options] [logfile1 logfile2 ...]
yeah that's it. options first, then as many logfiles as your heart desires. simple. elegant. slay.
π¦ DESCRIPTION π¦
The Logfile Navigator, aka lnav, is a log file viewer for the terminal. you hand it a set of files and/or directories, and lnav will literally:
- decompress as needed;
- detect their format;
- merge the files together by time into a single view;
- tail the files, follow renames, find new files in directories;
- build an index of errors and warnings;
- pretty-print JSON-lines.
the way it just... does all of that?? merging everything by time into one single view is the main character move here, fr fr. and it keeps tailing and finding new files while you watch. obsessed. π
π₯ KEY BINDINGS π₯
?β View/leave the online help text.qβ Quit the program.
that's the whole list and honestly? it's enough. question mark for help, q to dip. periodt. π
β¨ OPTIONS β¨
-hβ Print help and exit-Hβ Display the internal help text.-Ipathβ Add the given configuration directory to the search path.-Wβ Print warnings related to lnav's configuration.-uβ Update formats installed from git repositories.-dfileβ Write debug messages to the given file.-Vβ Print version information.-rβ Recursively load files from the given directories.-Rβ Load older rotated log files as well.-ccmdβ Execute a command after the files have been loaded.-fpathβ Execute the commands in the given file.-ecmdβ Execute a shell command-line.-tβ Prepend timestamps to the lines of data being read in on the standard input.-nβ Run without the curses UI. (headless mode)-Nβ Do not open the default syslog file if no files are given.-qβ Quiet mode. Do not print the log messages after executing all of the commands.
ngl, -t is the one that changes lives if you're piping stuff in. and -n for headless mode?? lowkey perfect for when you're being all automatable and mysterious. π
π Optional arguments: π
logfile1β The log files or directories to view. If a directory is given, all of the files in the directory will be loaded.
yep β hand it a directory and it just scoops up every file inside. so generous of it. π
π MANAGEMENT-MODE OPTIONS π
these ones are for when you're in your config era:
-iβ Install the given format files in the$HOME/.lnav/formats/installeddirectory and exit.-mβ Switch to the management command-line mode. This mode is used to work with lnav's configuration.-Cβ Check the configuration and exit. The log format files will be loaded and checked. Any files given on the command-line will be loaded checked to make sure they match a log format.
note the exact path there: $HOME/.lnav/formats/installed. that's where the format files go. write it down bestie π
heads up: -C isn't just vibes β it actually loads and checks the log format files, and it also loads and checks any files you gave on the command-line to make sure they match a log format. it's the "am i valid" check. π§
π EXAMPLES π
To load and follow the syslog file:
lnav
To load all of the files in /var/log:
lnav /var/log
To watch the output of make with timestamps prepended:
make 2>&1 | lnav -t
see that third one? that's the -t moment. piping make straight into lnav with timestamps and just watching. chef's kiss ππ₯
π AUTHOR π
This manual page was written by Salvatore Bonaccorso <carnil@debian.org> for the Debian system (but may be used by others).
π and that's the whole page!! this one's from April 2024, it's the LNAV(1) page, and it lives in the General Commands Manual. tysm for reading, go tail some logs, you ate πβ¨π¦
π¦ where this page comes from
- alpine 3.24: lnav-doc 0.14.0-r0 Β· BSD-2-Clause
- arch rolling: lnav 0.14.1-1 Β· custom:BSD
- debian trixie: lnav 0.12.4-1+deb13u1 Β· BSD-3-Clause
- epel 10: lnav 0.13.2-1.el10_2 Β· LicenseRef-Callaway-BSD
- fedora 43: lnav 0.12.4-2.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: lnav 0.13.2-2.fc44 Β· LicenseRef-Callaway-BSD
- nixpkgs unstable: lnav 0.14.1
- ubuntu questing: lnav 0.12.4-1
- ubuntu resolute: lnav 0.13.2-1 Β· BSD-3-Clause
- ubuntu stonking: lnav 0.13.2-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms