Modern FreeBSD comes with the pkg(8) package manager which is handy for installing precompiled binary packages. Like package managers elsewhere, the manager here is also very versatile. Here are some of the commands I use for daily purposes.
I use pkg-rquery(8) and pkg-query(8) whenever possible. The former queries the database in the repository and the latter queries the locally installed packages. The PkgPrimer shows different commands as in here. This is just a matter of taste on the output.
Before and Installing Packages
Listing available packages:
pkg search <keyword>
Obtaining information of a package:
pkg search --full <keyword>
Querying dependency packages according to the repository
pkg rquery %dn <package 1> <package 2> ...
Same as above, with the version numbers
pkg rquery %dn-%dv <package 1> <package 2> ...
Installing some packages
pkg install <package 1> <package 2> ...
After Installing Packages
Listing the installed packages
Querying information of an installed package
pkg info <package>
Querying which package brings in a file
pkg which <filename>
Querying files coming with some installed packages
pkg query %Fp <package 1> <package 2> ...
Same as above, with per-file checksums
pkg query "%Fp %Fs" <package 1> <package 2> ...
Querying dependency packages of some installed packages
pkg query %dn <package 1> <package 2> ...
Same as above, with version numbers
pkg query %dn-%dv <package 1> <package 2> ...
Checking versions of the installed packages
Uninstalling some packages
pkg delete <package 1> <package 2> ...