Datasheet
Table 1-2: Finding Commands
If you suspect that the command you want is not installed, you can search the ports
database for the package that it is in. If you find the right package (for example, bzflag)
and it isn’t installed, install it from the Internet as root by typing the following:
# find /usr/ports | grep ImageMagick
/usr/ports/gtraphics/ImageMagick
...
# pkg_add -r ImageMagick
The command just shown grabs the ImageMagick binary package (in tar bzip2
format) from a BSD software repository and installs it from the local system. Refer to
Chapter 2 for information on other methods of installing software, such as using the
ports system.
Command Reference Information in BSD
Original BSD, Linux and UNIX documentation was all done on manual pages, gener-
ally referred to as man pages. A slightly more sophisticated documentation effort came
a bit later with the info facility. Within each command itself, help messages are almost
always available.
This reference information is component oriented — in other words, there are separate
man pages for nearly every command, file format, system call, device, and other com-
ponent of a BSD system. Documentation more closely aligned to whole software pack-
ages is typically stored in a subdirectory of the
/usr/local/share/doc directory.
All three reference features — man pages, info documents, and help messages — are
available in BSD systems.
Command and Sample Output Description
$ type mount
mount is /sbin/mount
Show the first mount command in PATH.
$ whereis mount
mount: /sbin/mount
/usr/share/man/man8/mount.8.gz
Show binary and man page for mount.
$ locate xrdb.1.gz
/usr/local/man/man1/xrdb.1.gz
Find xrdb.1.gz anywhere in file system.
$ which umount
/sbin/umount
Find umount command anywhere in your
PATH or aliases.
$ pkg_info -W convert
/usr/local/bin/convert was
installed by package
ImageMagick-6.3.6.9
Find which package the convert command
is from.
8
Chapter 1: Starting with BSD Systems
76034c01.qxd:Toolbox 3/29/08 10:40 AM Page 8