Stop using tail -f (mostly)
161–170 of 211 posts
Re: Stop using tail -f (mostly)
#162Re: Stop using tail -f (mostly)
#163Doesn't read ANSI color codes! Looking through manual for that.
Interprets color codes as RAW, relaying them to the screen as-is.
Re: Stop using tail -f (mostly)
#164Interesting. I always preferred watch -n 1 -d 'tail /path/to/log/file' to tail -f because of its nice highlighting feature.
Re: Stop using tail -f (mostly)
#165Re: Stop using tail -f (mostly)
#166I was introduced to less +F a while ago and it is quite nice, but there is one simple "feature" of tail -f that I miss quite a lot: being able 'mark' the log with gaps by hitting enter a few times. This is especially handy when you have to first load a page or warm up the app before performing the operation you're interested in watching, letting you separate the earlier output from the lines generated by what you're…
Re: Stop using tail -f (mostly)
#167Earlier quoted context omitted.
I think your idea of `vi -R` or `vim -R` is a good idea. `less` uses less memory and may load faster but looking at logs for things like valgrind vim will give you syntax highlighting that I am not sure you can get with `less`.
BTW, starting vim as "view" (through e.g. a symlink) is equivalent to "vim -R", precisely for this use case [0]. [0] http://vimdoc.sourceforge.net/htmldoc/starting.html#view
readlink /usr/bin/view
exRe: Stop using tail -f (mostly)
#168Earlier quoted context omitted.
With less, you can use m to mark the current position and ' to go to a marked position. h will show you lots of useful help.
An example of some of the vi commands that less(1) has adopted. You can also: * page forward and backward, including using numeric prefixes to indicate a lineno or indicate "repeat 'n' times". * launch vi if less(1) is working on a file (versus (eg) stdout of some process) * search fwd/backward * start examining a new file w/o leaving less(1) * ...
Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden.
Re: Stop using tail -f (mostly)
#169This _almost_ touches on the useful part of this: If you search in less and then put it in follow mode, it continues to highlight the search terms. This is very useful for trapping an exception or webcall in the wild. The downside: less buffers and tail -f prints directly. On a slow printing log this can cause events to show up slowly, and can cause performance issues on a fast moving log. If you're piping through a…
I've commented a bit more on them (in the context of other RSS tools) here:
https://www.reddit.com/r/dredmorbius/comments/1udv6i/further...
Folkert's site: http://www.vanheusden.com/ http://www.vanheusden.com/multitail/ http://www.vanheusden.com/rsstail/
Though not quite applicable to logfiles, I've written a script to tail my Newsbeuter feed URLs with Multitail support, for a console / terminal-based RSS feed.