Linux command
lnav 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
lnav path/to/log
Example
lnav /var/log/
Example
lnav ssh user@host:/var/log/syslog
Validate
lnav -C path/to/log
Example
lnav -R /var/log/syslog
Example
lnav -n -c ":filter-in error" path/to/log
说明
lnav is an advanced log file viewer that leverages semantic information from log files. It can interleave messages from multiple files, create time-based histograms, and provides efficient navigation through logs using hotkeys.
参数
- -h
- Display help information
- -H
- Show internal help text
- -V
- Print version details
- -n
- Run in headless mode without UI
- -c CMD
- Execute command after loading files
- -f PATH
- Run commands from a configuration file
- -I PATH
- Add directory to configuration search path
- -q
- Quiet mode; suppress messages
- -i
- Install format files to user directory. Pass 'extra' to install the default set of third-party formats.
- -u
- Update installed format files from repositories
- -a
- Load all of the most recent log file types
- -C
- Validate configuration and log format files
- -d FILE
- Output debug messages to file
- -r
- Recursively load files from directories
- -R
- Include rotated and archived log files
- -t
- Add timestamps to stdin data
- -w FILE
- Write stdin content to file
FAQ
What is the lnav command used for?
lnav is an advanced log file viewer that leverages semantic information from log files. It can interleave messages from multiple files, create time-based histograms, and provides efficient navigation through logs using hotkeys.
How do I run a basic lnav example?
Run `lnav path/to/log` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -h do in lnav?
Display help information