[balug-talk] don't know which command handles what you're interested in

Michael Paoli Michael.Paoli at cal.berkeley.edu
Fri Dec 8 14:25:09 PST 2006


> I find it's a minor problem with the Debian way of doing things
> that in advance you don't know which command handles what you're
> interested in, so you don't know which man page to start with.

Isn't that pretty much the case for Linux/UNIX/BSD in general?

There are, however, some tools to help one locate the command(s),
e.g. apropos(1), or likewise man -k for some *nix flavors.
$ apropos package | wc -l
142
$ apropos package | fgrep dpkg | wc -l
19
$ apropos package | fgrep dpkg | less
...
$ apropos package | fgrep dpkg | fgrep -v source
debsums_gen (8)      - Generate /var/lib/dpkg/info/*.md5sums for packages lacking it
dpkg (8)             - a medium-level package manager for Debian
dpkg-architecture (1) - set and determine the architecture for package building
dpkg-deb (1)         - Debian package archive (.deb) manipulation tool
dpkg-depcheck (1)    - determine packages used to execute a command
dpkg-divert (8)      - override a package's version of a file
dpkg-genbuilddeps (1) - generate a list of packages used to build this package
dpkg-name (1)        - rename Debian packages to full package names
dpkg-preconfigure (8) - let packages ask questions prior to their installation
dpkg-reconfigure (8) - reconfigure an already installed package
dpkg-scanpackages (1) - create Packages files
dpkg-split (8)       - Debian package archive split/join tool
reviewing the descriptions would seem to limit getting/setting package
selections to a very small subset of those listed commands (dpkg(8)) likely
appearing the most probable among them), and review of dpkg(8) would show the
desired functionality.
Even if we'd started with something more like:
$ apropos package | fgrep -i deb
(perhaps not knowing the name of the dpkg or related commands, but
just that they're packages, and they're of type "deb".)
and narrowed that to:
$ apropos package | fgrep -i deb | fgrep -v source
it would be a slight bit more to review, but again, fairly quickly we
can focus in on one to a few possible commands for what we're looking
for, and we do then find the needed functionality on one of those
commands.

Another example, someone was asking about a "line" oriented diff, but
they really wanted to isolate differences on very long quite similar
lines ... so I think they probably want to isolate to "words" or
something like that:
$ apropos word | fgrep diff
wdiff (1)            - display word differences between text files
And hence I discover wdiff - which also likely well solves their
problem at hand.

The "trickiest" part is often guessing what keywords would likely be
present in the man page names and descriptions.  Trying various
synonyms and/or related terms is often quite useful.  Also trying to
use terms unlikely to be present on most other manual pages is also
useful to help quickly narrow the search.

references:
apropos(1)
man(1)
news:1164571608.315944.170250 at l39g2000cwd.googlegroups.com
http://lists.balug.org/pipermail/balug-talk-balug.org/2006-December/003887.html
et. seq.


More information about the balug-talk mailing list