7 ms·
Use '/' (search) to enter a regexp to match a pattern on that line, and it will be highlighted.
by toddkaufmann 11y ago
Use '/' (search) to enter a regexp to match a pattern on that line, and it will be highlighted.
- lgas 11y agoThis has nothing to do with what is being discussed in this subthread.
- teraflop 11y agoSure it does. If your log lines are distinct (e.g. they have timestamps or unique IDs) then you can use less's search highlighting to provide a visual marker for a specific line, similar to what you can do by manually inserting a bunch of blank lines on the console. This trick doesn't work if your log file has a bunch of identical lines and you want to keep an eye on their rate, though.
- shawabawa3 11y agoimagine the scenario: "I want to see everything that happens in a single request" Enter method: 1. Press enter a bunch of times 2. Reload browser 3. Press enter a bunch of times and scroll up Your method: 1. Search for last line in output to highlight it? 2. Reload page 3. Try and figure out where stuff starts and ends with loads of visual noise
- MadcapJake 11y agoless method: 1. ma 2. Reload browser 3. 'a less method with two marks: 1. ma 2. Reload browser 3. mb 4. 'a
- ajanuary 11y agoUnfortunately mark doesn't seem to work while you're following.
- teraflop 11y agoI won't argue that for this specific use case, tail isn't friendlier than less. But the original poster posted a useful tip, and is now getting aggressive downvotes and comments like "This has nothing to do with what is being discussed in this subthread." I think that's unwarranted.
- gojomo 11y agoHaving to remember & type a timestamp has much more mental overhead (planning & memory) than "scan/scroll back to last block of vertical whitespace". That's why suggestions of either named-marks or back-searches aren't considered equally-attractive alternatives to marking the scrollback with a batch of <return>s.
- shangxiao 11y agoA bunch of blank lines is a lot more grokable than timestamps lost in a bunch of text.