3 ms·
I find it very convenient to open large log files bc Nano is very lightweight. Something like that: $ cat /var/log/logfile | grep -n section_start which gives
by tretiy3 10y ago
I find it very convenient to open large log files bc Nano is very lightweight. Something like that:
$ cat /var/log/logfile | grep -n section_start
which gives me required line numbers. and then:
$ nano +lineno /var/log/logfile
and for configs, of course.
- Programmatic 10y agoI would go straight to vim and type: "/section_start<cr>", which navigates straight to that line. Then navigate to the line, "i" to enter insert mode, make edits, and "<esc>:wq<cr>". It is absolutely a learning curve, but the power of vim is insane. "dd" deletes lines, "A" appends to the end, "I" inserts at the beginning, "<lineno>G" jumps to a line number, all little tweaks that I use nearly every day in editing files quickly. It's especially nice when editing known_hosts where it tells you the line of the offending key, just "<line#>Gdd:wq" and it's done.
- ryanlol 10y ago>I find it very convenient to open large log files bc Nano is very lightweight. Nano seems to be far slower than vim for opening large files. Just quickly testing on a 200M 500k row text file on a SSD: Vim opens practically instantly. nano takes over 10 seconds to display text, but works well after that.