Remix.run Logo
teeray 7 hours ago

Surprised they missed follow! It’s a bit odd to use, but once you get used to it it’s better than tail in many circumstances IMO. `less +F` starts less following stdin or whatever file argument you’ve provided. <C-c> breaks following, allowing you to search around a business-as-usual `less` session. Hitting `F` (that’s uppercase) starts following again. Yes, you can just start following within a session with `F` too if you forgot to add +F to the `less` invocation.

joombaga 5 hours ago | parent | next [-]

With `tail` you can press enter a few times to put some empty lines after the last line. This is useful e.g. when you trigger a function multiple times and want to easily see line groups from each attempt. It's the only reason I still use `tail` for following when `less` is available.

teeray 4 hours ago | parent [-]

A visual mark would be nice, agreed. I haven't tried it, but I wonder if you could approximate it with the bookmarking feature that less(1) does have. It wouldn't be visible, but it would scroll to a consistent mark.

vladvasiliu 2 hours ago | parent [-]

I usually use tail when I need to do some ad-hoc log following.

Having to set bookmarks and remember them is a PITA I can usually do without. If I'm looking at "normal" log output, it's usually set up in a nice aggregator somewhere, where I can easily exclude noise and otherwise uninteresting output.

CBLT 4 hours ago | parent | prev | next [-]

If you're following a pipe (such as `kubectl logs | less +F`), <C-c> is sent to all processes in a pipeline, so it stops less from following and it stops the other process entirely. Then you can't start following again with F, or load more data in with G.

Less provides an alternative of <C-x> to stop following, but that is intercepted by most shells.

vbezhenar an hour ago | parent | next [-]

> Less provides an alternative of <C-x> to stop following, but that is intercepted by most shells.

WoW, thanks a lot! That was my pain for many years. C-x works in Gnome Console just fine.

mananaysiempre an hour ago | parent [-]

Funnily enough, it literally tells you right there on the bottom line: “Waiting for data... (^X or interrupt to abort)”. No shame in not noticing, just another case of blindness to long-familliar messages I guess.

mananaysiempre an hour ago | parent | prev [-]

By the shell or by the kernel’s terminal discipline or by the terminal emulator? AFAIU the shell is basically out of the picture while `less` is running.

xg15 3 hours ago | parent | prev | next [-]

Maybe OT, but I thought for a long time that "follow" was some sophisticated file descriptor trickery that required you to somehow "stream" the file while reading and would therefore be incompatible with opening a file "normally".

My mind was blown when finding out its really just "keep on polling after EOF". Meaning there is absolutely no difference between opening a file normally and "following" a file - and software could easily switch between the two "modes" on the fly.

layer8 6 hours ago | parent | prev | next [-]

It would be nice to have a mode that follows in the sense of automatically picking up new output, but that simultaneously would let you navigate around, similar to how terminals behave. Then you’d only need an autoscroll toggle for when you’re at the bottom.

gerdesj 4 hours ago | parent [-]

Take a look at "lnav" ...

sprt 7 hours ago | parent | prev [-]

I'm so mad that I didn't know the hitting F thing!