[lug] mail command sytax per subject

Walter Pienciak walter at frii.com
Mon Jul 9 14:57:12 MDT 2001


On Mon, 9 Jul 2001, D. Stimits wrote:

> > You may be dealing with several "mail" programs on your system.
> >
> > Find your various mail programs ( find / -name "mail*") and try
> > your command using the full pathname of each.
>
> Or type "which mail".

Nope.  You may be thinking of the related 'whereis' command.

'which' is a useful command when you have several executables with
the same name in your $PATH.  'which mail' responds with the pathname
of which "mail" program will actually be run if you simply type
'mail'.  Depending on the order of directories in your $PATH, the response
will vary.

[1] which mail
/bin/mail
[2] whereis mail
mail: /etc/mail /usr/bin/mail /usr/ucb/mail

Both of these are dependent on your PATH value being fairly comprehensive,
which may or may not be the case on an arbitrary system.  Hence my suggestion
to use find, which avoids that problem.  In fact, on systems I don't maintain
or co-maintain, I usually stick the following command in a crontab and run it
$PERIODICALLY:

find / -ls | /opt/gnu/bin/gzip -9 > /find-ls.txt.gz

Then, instead of thrashing the disk for libs and includes and strange
man dirs not being found, I can just

zgrep $WHAZZAT /find*   (I'm a lazy typer)

Walter




More information about the LUG mailing list