Useful Unix Utilities

07/19/2001

Whenever I get a chance to roam through the ports collection, I always end
up feeling like a kid in a candy store.

At the moment, there are nearly
5,500 ports to choose from and they're all just a make install clean
away. In today's article, I'd like to concentrate on some of the more
useful ports I've come across in the last month or so, but I'm sure I'll
also wander a bit into the less-than-useful-but-worth-trying-out-anyways
ports as well.

As a reminder, if you find a port you're interested in, become the
superuser, cd into the directory of the port you wish to build,
and type make install clean. If you use either csh or tcsh as your
shell, type rehash when the build is finished so the new executable will
be in your path. If you're curious as to where the executable was
installed, which name_of_port should reveal the path.

As any of my students can attest, I'm a stickler for ensuring they
know how to quickly calculate anything possible in IPv4 addressing
land. From subnet masks to CIDR notation to broadcast IDs to Cisco
wildcard bit masks, they end up learning far more about TCP/IP than they
could have anticipated. If you're a bit rusty on your calculations, there
are several utilities in the ports collection that deal with subnet
masks and IPv4 addressing.

The whatmask utility in the net section is a very quick way to
see a subnet mask in CIDR notation, regular notation, or its wildcard bit
mask equivalent. (Wildcard bit masks are used in Cisco access lists.) If
you just type whatmask, you'll see that it uses a very basic syntax:

whatmask comes with ABSOLUTELY NO WARRANTY; for details see the COPYING file
that accompained this distribution. This is free software, and you are welcome
to redistribute it under the terms of GNU PUBLIC LICENSE.

Very short and sweet, and this can save a few brain cells when you're in a hurry
and don't feel like doing math. If you also need to determine the subnet
IDs, broadcast addresses, and host IDs provided by a subnet mask, you can
save yourself some calculations using the ipcalc utility, also found in
the net section of the ports collection. Again, type ipcalc for its
syntax: