[PLUG] An obscure (at least to me) useful tool

Rodney W. Grimes freebsd at gndrsh.dnsmgr.net
Thu May 23 14:18:31 UTC 2019


> I've used the -n option to cat recently to get line numbers. E.g.:
> 
>   cat -n README.txt
> 
> I don't remember using nl before.

cat -n was probably added by someone who could not find nl(1),
as nl is a unix filter in the truest since of the word, it does
one thing and it does it very well, with many options and fancy
pointed sticks decorated as options.

can -n should die, or better, should of never been written, that
is adding formatting function to a filter that is not a formatting
filter.

Just my $1.00 worth of rant.

Now, the suggestion, all people new to "unix" in any since of
that word should read the AT&T V7 manual sections 1 and 8, those
commands are pretty much still here, and that set of options is
also pretty much every place.  You may find some real nuggets you
did not know existed, AND you may come to realize how much you
can actually do with a very small set of commands.

Sadly nl didnt come along until SVR2, it is however a Posix thing.

> 
> On Wed, May 22, 2019 at 11:15 AM Rich Shepard <rshepard at appl-ecosys.com>
> wrote:
> 
> > Those of you who are professional system/network admins probably know about
> > the little tool, 'nl,' that numbers lines in text files
> > <https://ss64.com/bash/nl.html>. For non-professionals like me it's a
> > great
> > find as I work regularly with text files and it solved a problem more
> > quickly than by using gawk.
> >
> > Perhaps others will find this useful on occasion.
> >
> > Regards,
> >
> > Rich
> > _______________________________________________
> > PLUG mailing list
> > PLUG at pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
> _______________________________________________
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 

-- 
Rod Grimes                                                 rgrimes at freebsd.org



More information about the PLUG mailing list