News for hackers. Stuff that matters.
Re:Stop using tail -f (mostly) by pjungwir on Monday March 30, 2015 @02:03PM (#9291330)
Just the other day I was looking for a way to do this in less:

yank 10 lines, open a new file, paste the 10 lines, save the file.

Is that possible? My Googling last week didn't find a good solution.

Re:Stop using tail -f (mostly) by bch on Monday March 30, 2015 @02:35PM (#9291567)
If you wanted to grab 10 lines from /var/log/messages, starting at the first line that has "pjungwlr" in it, you could:

  $ less /var/log/msgs
  /pjungwlr^M
  ^G (note line informational line numbers)
  v (launch vi)
  [double check your line #s, etc]
  :d1,. (delete from 1st line, to current line)
  10j (go down 10 lines)
  :d,$ (delete to EOF)
  :w my_newfile
  :q
Re:Stop using tail -f (mostly) by technofiend on Monday March 30, 2015 @03:37PM (#9292016)
This is such a common problem there's a stackoverflow article on it.

http://stackoverflow.com/questions/17908555/printing-with-se...

(Actually, there's probably more than one despite their really good duplication grooming, but this was the first hit.)

Re:Stop using tail -f (mostly) by pjungwir on Monday March 30, 2015 @03:49PM (#9292101)
`v` was the missing key for me. Looks like it even preserves my position in the file. Thanks!
Re:Stop using tail -f (mostly) by kragen on Monday March 30, 2015 @04:57PM (#9292560)
Usually I `ma|acat > newfile` in less, which saves by default a whole screenfull. There must be a better way to do this in less.