4 ms·
If you're fiddling with logs, pick an editor that can handle (theoretically) unlimited file sizes -- which is something that very few mention supporting. vim wi
by rcarmo 5y ago
If you're fiddling with logs, pick an editor that can handle (theoretically) unlimited file sizes -- which is something that very few mention supporting. vim will do you great stead for what you seem to need.
- Severian 5y agoYeah, buffering in an editor is important. I'll look into Vim a little more.
- Koshkin 5y agoThat’s what I have never understood - why would you want to open a log file in a text editor (when the standard tools of the trade in this case should be an “unbuffered” text viewer, which by design, can handle files of any size, fgrep, and, if you want to generate a report, a stream editor, such as sed).
- imiric 5y agoExactly. Log files are viewed in a pager, not an editor. While tools like lnav look great, many of its features can be replicated by combining smaller, purpose built tools, i.e. the core Unix philosophy. Single log view: cat | less Filters: rg | less Decompression: zless, zgrep, rg -z Timeline view: admittedly tricky, but doable with some incantation of cut, sort or reach for the big guns: awk, perl. Live operation: not quite, but tail -f and less +F go a long way. I've never once in almost 20 years of looking at log files thought I needed a SQL interface to them. I'm sure it's a powerful feature, but the above approach has served me well.