Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Compact Reference
Guide
Sponsored By
Broadcasting World
www.broadcastingworld.net
Written By
David Childers
The FreeBSD Documentation License
Redistribution and use in source (SGML DocBook) and 'compiled' forms (SGML, HTML, PDF, PostScript, RTF
and so forth) with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code (SGML DocBook) must retain the above copyright notice, this list of
conditions and the following disclaimer as the first lines of this file unmodified.
2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other
formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Important: THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
www.freebsd.org/copyright/freebsd-doc-license.html
This body of work is released under the Attribution-ShareAlike version 3.0, Creative Common License.
The work may be freely distributed or modified for commercial or non commercial purposes.
If this work is modified, compliance with the Attribution-ShareAlike version 3.0, Creative Common License is
required.
Cover graphic - This picture was taken from the Dictionnaire encyclopédique Trousset, also known as the
Trousset encyclopedia, Paris, 1886 - 1891.
www.oldbookillustrations.com/pages/vignette1.php?lng=en
About The Author
David Childers is the Content Manager and Senior Editor for the International Broadcasting portal
www.BroadcastingWorld.net. He is also the webmaster of the SHOUTcast video streaming information
resource, www.scvi.net. He is very active in the Internet broadcast industry.
Mr. Childers' work has been cited in several national and International publications, such as:
Video Podcasting in Perspective: The History, Technology, Aesthetics and Instructional Uses of a New Medium
Journal of Educational Technology Systems
Video Podcasting: When, Where and How it's Currently used for Instruction
The National Convention of the Association for Educational Communications and Technology
There are numerous publications available for the FreeBSD enthusiast, and you can fill a library with Unix
reference publications as well. However, there are no readily available compact reference guides for the
typical FreeBSD user. I want to continue my contribution to the FreeBSD and Open Source movement and
provide such a guide.
I would like to thank Scarlet Coker for providing assistance with the editing of the manuscript and James
Davey at Broadcasting World for allowing me the opportunity to create this guide.
It is my sincere hope that the reader finds this reference guide beneficial.
David Childers
www.scvi.net
April 2010
Brian Kernigan
Please Donate
If you find this guide useful, please consider making a small donation to show your appreciation for my work.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=10870717
Index
- Directory Structure
- Common Commands
- Additional Information
Directory Structure
Directory Description
/boot/ Programs and configuration files used during operating system bootstrap.
/etc/periodic/ Scripts that are run daily, weekly, and monthly, via cron.
/mnt/ Empty directory commonly used by system administrators as a temporary mount point.
/sbin/ System programs and administration utilities fundamental to both single-user and multi-
user environments.
/tmp/ Temporary files. The contents of /tmp are usually NOT preserved across a system reboot. A
memory-based file system is often mounted at /tmp. This can be automated using the
tmpmfs-related variables of rc.conf (or with an entry in /etc/fstab).
/usr/local/ Local executables, libraries, etc. Also used as the default destination for the FreeBSD ports
framework. Within /usr/local, the general layout sketched out by hier for /usr should be
used. Exceptions are the man directory, which is directly under /usr/local rather than
under /usr/local/share, and the ports documentation is in share/doc/port.
/var/ Multi-purpose log, temporary, transient, and spool files. A memory-based file system is
sometimes mounted at /var. This can be automated using the varmfs-related variables of
rc.conf (or with an entry in /etc/fstab).
/var/tmp/ Temporary files. The files are usually preserved across a system reboot, unless /var is a
memory-based file system.
/boot/loader.conf
/etc/fstab
This file contains descriptive information about the various file systems.
/etc/ftpusers
This file contains a list of users that may not log in using the File Transfer Protocol (FTP) server daemon.
/etc/group
/etc/hosts
/etc/hosts.allow
This file contains the names of the hosts which are allowed to use local resources.
/etc/hosts.equiv
This file contains the names of trusted remote hosts and users.
/etc/hosts.lpd
This file contains a list of hostnames or IP addresses that are allowed to use local print services.
/etc/inetd.conf
This is the default configuration file for the inetd (super-server) daemon.
/etc/login.access
This file specifies (user, host) combinations and/or (user, tty) combinations for which a login will either be
accepted or refused.
/etc/login.conf
This file contains various attributes and capabilities of login classes. A login class (A optional annotation
against each record in the user account database, /etc/master.passwd.) determines session accounting,
resource limits and user environment settings which are specified.
/etc/make.conf
This file contains system-wide settings that will apply to every build using make and the standard sys.mk file.
/etc/newsyslog.conf
This file is used to set log file rotation configuration for the newsyslog utility.
/etc/rc.conf
This file contains descriptive information about the local host name and configuration details for any potential
network interfaces. It also specifies which services should be started at the system initial boot time.
/etc/ssh/sshd_config
This file contains configuration information for the OpenSSH SSH daemon.
/etc/sysctl.conf
/etc/syslog.conf
/etc/ttys
This file contains information that is used by various routines to initialize and control the use of terminal
special files.
Memory Devices And File Systems
Code Device
cd SCSI CDROM
fd Floppy disk
To enable device auto mount, the HAL daemon must be initialized when the computer is started.
HAL provides a hardware abstraction layer. Its purpose is to allow desktop applications to discover and use
the hardware of the host system, regardless of the type of hardware.
This command can be used to verify that the attached device is present.
# dmesg
The Unix file system (UFS) is a file system used by many Unix and Unix-like operating systems. Some of the
things that make UFS unique include:
* A few blocks at the beginning of the partition reserved for boot blocks, which must be initialized separately
from the file system.
* A superblock, containing information identifying this as a UFS file system, and additional data describing the
file system's geometry, statistics, and behavioral tuning parameters.
* A collection of cylinder groups.
UFS2 is an extension to the well-known UFS. It adds 64 bit block pointers (breaking the 1T barrier), support
for extended file storage, in addition to other features.
ZFS is a combined file system and logical volume manager designed by Sun Microsystems. Some features of
ZFS include:
* Support for high storage capacities.
* Integration of the concepts of file system and volume management.
* Snapshots and copy-on-write clones.
* Continuous integrity checking and automatic repair.
* RAID-Z and native NFSv4 ACLs.
The ext2 or second extended file system is a file system for the Linux kernel.
The ext3 or third extended file system is a journaled file system that is commonly used by the Linux kernel.
System Information Commands
Hardware Configuration
CAM subsystems.
This utility provides the user with access and control of the FreeBSD CAM subsystem. Improper use of this
utility can cause a loss of data and/or system crashes.
# camcontrol
ata subsystems.
This utility provides the user with access and control of the FreeBSD ata subsystem. (ATA device driver
control program.)
# atacontrol
Kernel modules.
This utility loads file.ko files into the kernel using the kernel linker.
# kldload [Name of kernel module to be loaded.]
Example output:
FreeBSD 8.0-RELEASE i386
Example output:
CPU: Pentium 4 (1716.41-MHz 686-class CPU)
acpi_cpu0: on acpi0
acpi_cpu: CPU throttling enabled, 8 steps from 100% to 12.5%
Determine the real and available memory in FreeBSD.
# dmesg | grep memory
Example output:
real memory = 201326592 (192 MB)
avail memory = 188555264 (179 MB)
List who is logged into the system and where they are logging in from.
# who
Login Commands
Disk Commands
Printer Commands
General Commands
Look up a word in an electronic version of Webster's dictionary and display the definition(s) .
# webster [word]
Directory Commands
List the files in the directory specified, or the current directory you are in.
You can also add additional arguments to customize the list display.
# ls [directory] [option]
Options:
The -f option will append a forward slash to the subdirectory names so you can easily distinguish them from
file names.
The -a option will show all hidden files. Hidden files begin with a dot (.), such as .htaccess files.
The -l option will show detailed information about each file and directory, including permissions, ownership,
file size, and when the file was last modified.
File Commands
Class
u The user who owns the file.
g The group the file belongs to.
o The other users.
a All of the above.
Operation
+ Adds the mode to the specified class.
- Removes the specified mode from the specified class.
= The modes specified are to be made the exact modes for the specified class.
Mode
r Permission to read the file.
w Permission to write or delete the file.
X Permission to execute the file.
Rename file.
# mv old_file_name new_file_name
Compression Commands
Installing Packages
Local installation
pkg_add package_name
You must navigate to the location where the package is residing and execute the pkg_add command with the
exact file name to install the package.
Example:
# cd /home/user/Desktop/
# pkg_add wow_1234.tbz
Installing Ports
Example
Install:
# make install clean
Display a list of all currently installed packages that have a specified word in the package name.
# pkg_info | grep -i package_name
Removes packages and ports.
# pkg_delete package_name
# mkdir /media/cdrom
The computer hardware DOES support ACPI - Advanced Configuration and Power Interface.
(ACPI hardware compatability can be determined by checking the computer BIOS configuraiton.)
# shutdown -p now
Adding Hardware
Additional network interface cards can be configured after the FreeBSD installation.
- Initiate sysinstall:
# sysinstall
* If the install network interface card is not listed, you will need to manually configure the device.
www.freebsd.org/doc/en/books/handbook/config-network-setup.html
Load all sound card device drivers for audio hardware with the sound driver module:
# kldload snd_driver
Display which sound card device driver was selected and initialized:
# cat /dev/sndstat
Wifi Security
WEP
(IT IS HIGHLY ADVISABLE NOT NOT TO UTILIZE WEP, DUE TO SECURITY ISSUES.)
WPA
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
Start the dhclient command to acquire the IP address from the DHCP server:
# dhclient wlan0
* Important * Manually executing the dhclient is not necessary, if the /etc/rc.conf was properly configured
with ( ifconfig_wlan0="DHCP”)
# nano /usr/local/etc/cups/mime.types
# nano /usr/local/etc/cups/mime.convs
If cups does not natively support your printer, you can attempt to install additional printer drivers. You can
find additional printer driver information located here: www.cups.org/ppd.php.
The printer device ppd file needs to be placed in the CUPS "model" directory. This directory stores all PPD
files. This directory is located at: /usr/local/share/cups/model.
Linux Resources
Linux emulation allows the installation and execution of Linux compiled software on the FreeBSD operating
system.
The base set of packages needed in Linux mode for i386/amd64 (Linux Fedora 10) must be installed.
# cd /usr/ports/emulators/linux_base-f10/
# make install clean
Wine Resources
Wine
This software allows you to run Windows software on other operating systems.
www.winehq.org
Q4Wine
This is a QTt4 GUI for Wine. It will assist in managing wine prefixes and installed applications.
q4wine.brezblock.org.ua
Winetricks
This is a quick and dirty script to download and install various redistributable runtime libraries sometimes
needed to run programs in Wine.
wiki.winehq.org/winetricks
# wget http://www.kegel.com/wine/winetricks
# mv winetricks winetricks.sh
# chmod 755 winetricks.sh
# ./winetricks.sh
Miscellaneous
Shells
This software provides an interface for users to access the services of a kernel.
www.freebsd.org/ports/shells.html
www.freebsd.org/doc/en/books/handbook/shells.html
Firewalls
The following highlighted message is displayed on the screen as part of the boot process:
ipfw2 initialized, divert disabled, rule-based forwarding disabled, default to deny, logging disabled
The IPFW sample ruleset can be found in the following files /etc/rc.firewall and /etc/rc.firewall
OpenBSD Packet Filter (PF) is similar to IPFilter, with some modifications to make it clearer.
Software
Virus
clamav
Command line virus scanner written entirely in C.
# pkg_add -r clamav
Configuring clamav.
Jail Resources
The FreeBSD jail mechanism is an implementation of operating system-level virtualization that allows
administrators to partition a FreeBSD-based computer system into several independent mini-systems called
jails. This is used to protect the computer system from being compromised by running specific software
applications.
ezjail
A framework to easily create, manipulate and run FreeBSD jails.
# pkg_add -r ezjail
jailadmin
A system for managing a set of named jails.
# pkg_add -r jailadmin
Ensure that the FreeBSD ports collection has been installed and that is is current.
# cd /usr/ports/java/diablo-jre16/
# make clean
Webcam support
Webcamd is a daemon that enables use of hundreds of different USB based webcam and DVB USB devices
under the FreeBSD-8/9 operating system.
Installation:
# cd /usr/ports/multimedia/webcamd/
# make install clean
GNU Parted
This is an industrial-strength package for manipulating partition tables.
www.gnu.org/software/parted/download.shtml
Wifimgr
A GUI-based tool to manage WiFi network configuration.
opal.com/freebsd/ports/net-mgmt/wifimgr
Written
References
FreshPorts has everything you want to know about FreeBSD software, ports, packages and applications.
www.freshports.org