| ▲ | 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. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | 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. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | 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. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | sprt 7 hours ago | parent | prev [-] | ||||||||||||||||||||||
I'm so mad that I didn't know the hitting F thing! | |||||||||||||||||||||||