[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion for new coreutil: "every" prints every M out of N lines

From: Wayne Hayes
Subject: Suggestion for new coreutil: "every" prints every M out of N lines
Date: Fri, 14 Oct 2005 18:07:00 -0700
User-agent: Mutt/1.4i


I'm a long-time (almost 25 years) Unix user and I have a utility
that I wrote years ago that might be of interest.  I use it almost
every day and am surprised something like it doesn't already exist.
Here's the beginning of the man page:

    every [-M[,N]] [OPTIONS] [list-of-files]

    Print N lines out of every M lines in a file.  If no files are
    listed, use the standard input.  N and M both default to 1, so that
    every(1) without options acts like cat(1).  Every(1) can also work
    on bytes or blocks instead of lines.

... there's more to the man page but I won't bore you with it.

Uses: great for getting a sample of a long file, especially if the file
is formatted so that every line is the same.  I most often use it to
sample the output of long simulations without having to page through
megabytes of output, although I've found other interesting uses for it
as well.  For me, every(1) is almost as essential as head(1) and tail(1),
and has virtually the same syntax and options.

Do you folks think this might be a more broadly useful utility?  I already
have a man page for it and would be happy to be the maintainer of it.

 - Wayne

reply via email to

[Prev in Thread] Current Thread [Next in Thread]