On Sun, May 31, 2020 at 03:18:47PM +0300, Konstantin Khlebnikov wrote: > On 31/05/2020 14.49, Sami Kerola wrote: > > On Sat, 30 May 2020 at 15:08, Konstantin Khlebnikov > > <khlebnikov@xxxxxxxxxxxxxx> wrote: > > > Option --follow-new (-W) works the same as --follow (-w) but initially > > > seeks to the end of kernel ring buffer, so it prints only new messages. > > > Useful for capturing kernel messages during actions without past log. IMHO good idea. > > I wonder if it would be more useful to add '-n, --lines=[+]NUM' that > > would be similar > > to tail(1) option and argument. The --follow-new with an option that > > lists NUM last > > messages would be --lines=0 It does not seem use-friendly ;-) I guess type "-W" is pretty straightforward. > > That said should --since and --until options similar to journalctl(1) > > be considered > > as well? --since '1 hour ago' would be nice, but I have doubts it's will so easy to implement due to crazy timestamps in the log. > Implementation is also non-trivial - currently dmesg reads and prints > messages from /dev/kmsg in a loop. It doesn't know how many lines left. > /dev/kmsg doesn't support lseek with non-zero offset, only SET/DATA/END. Yes. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com