BUY THIS BOOK
Add to Cart

Print Book $9.95


Add to Cart

Print+PDF $12.93

Add to Cart

PDF $7.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £6.95

What is this?

Looking to Reprint or License this content?


Essential System Administration Pocket Reference
Essential System Administration Pocket Reference Commands and File Formats By Æleen Frisch
November 2002
Pages: 144

Cover | Table of Contents


Table of Contents

Chapter 1: Essential System Administration Pocket Reference
This book serves as a quick reference to the most important system administration commands, options, configuration files, and tasks on Unix systems, including specifics for AIX, FreeBSD, HP-UX, Linux, and Solaris. For more details about any item or topic, consult a general system administration reference (e.g., Essential System Administration, Third Edition, O'Reilly & Associates).
Items in this book are grouped by topic (see the Table of Contents). Within each topic, items are in more-or-less alphabetical order, although related items are kept together (use the Index to find any particular item).
This book uses the following font and symbol conventions:
Italic
Used for the names of users and groups, files and directories, and replaceable parameters within normal text.
constant width bold
Used for Unix commands, options, program names, and configuration-file literals and keywords.
constant width italic
Used for replaceable parameters in commands, options, and configuration-file formats.
a|b
Indicates a choice among items (e.g., a or b).
[optional]
Optional items are enclosed in square brackets.
command+
Open source commands are marked by a plus sign.
su
su [-] [user] [-c "command"]
Run a command as another user (defaults to root). If no command is specified, a new shell is started. If the initial hyphen is included, then the user's login environment is duplicated.
Limiting access to su
AIX
Limited to groups listed in the sugroups attribute for root in /etc/security/user.
FreeBSD
Define the member list for group 0 as non-null.
Linux
Use the pam_wheelmodule in the su file.
su log file
AIX:
/var/adm/sulog
FreeBSD:
/var/log/messages
HP-UX:
/var/adm/sulog
Linux:
/var/log/messages
Solaris:
Specified in the SULOG setting in /etc/default/su.
Limiting direct root logins to the console
AIX
chuser ttys="/dev/lft,/dev/tty0" rlogin=false root
FreeBSD
Omit secure from all entries in /etc/ttys except console.
HP-UX
/etc/securettylists devices where
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Introduction and Font Conventions
This book serves as a quick reference to the most important system administration commands, options, configuration files, and tasks on Unix systems, including specifics for AIX, FreeBSD, HP-UX, Linux, and Solaris. For more details about any item or topic, consult a general system administration reference (e.g., Essential System Administration, Third Edition, O'Reilly & Associates).
Items in this book are grouped by topic (see the Table of Contents). Within each topic, items are in more-or-less alphabetical order, although related items are kept together (use the Index to find any particular item).
This book uses the following font and symbol conventions:
Italic
Used for the names of users and groups, files and directories, and replaceable parameters within normal text.
constant width bold
Used for Unix commands, options, program names, and configuration-file literals and keywords.
constant width italic
Used for replaceable parameters in commands, options, and configuration-file formats.
a|b
Indicates a choice among items (e.g., a or b).
[optional]
Optional items are enclosed in square brackets.
command+
Open source commands are marked by a plus sign.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
The root Account
su
su [-] [user] [-c "command"]
Run a command as another user (defaults to root). If no command is specified, a new shell is started. If the initial hyphen is included, then the user's login environment is duplicated.
Limiting access to su
AIX
Limited to groups listed in the sugroups attribute for root in /etc/security/user.
FreeBSD
Define the member list for group 0 as non-null.
Linux
Use the pam_wheelmodule in the su file.
su log file
AIX:
/var/adm/sulog
FreeBSD:
/var/log/messages
HP-UX:
/var/adm/sulog
Linux:
/var/log/messages
Solaris:
Specified in the SULOG setting in /etc/default/su.
Limiting direct root logins to the console
AIX
chuser ttys="/dev/lft,/dev/tty0" rlogin=false root
FreeBSD
Omit secure from all entries in /etc/ttys except console.
HP-UX
/etc/securettylists devices where root is allowed to log in (omit "/dev/" from the names).
Linux
Use the pam_securettymodule.
Solaris
/etc/default/login: CONSOLE=/dev/console
sudo+
sudo [options] command
Run the specified command using the sudo facility. After successfully entering his password, a user can use the sudo command without having to re-enter it for a grace period (defaults to 5 minutes).
Options
-v
Reset the grace period to its full length.
-K
Terminate the grace period.
-u user
Run the command as the specified user (rather than root).
-l
List allowed commands for the current user and host.
Configuration file: /etc/sudoers
# alias definitions
Host_Alias NAME=host[,host...] Named list of hosts
User_Alias NAME=user[,user...] Named list of users
Cmnd_Alias NAME=cmd[,cmd...]	Named list of commands

# user access entries
user host = cmds [: host = cmds...]
The final line grants access to the specified commands on the indicated host. User is the name of a user, a group (precede its name with %), or previously-defined user alias, and host and cmds are lists of individual hosts/commands and/or defined aliases. Precede an item with ! to deny access.
The sudo package provides the
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Essential Administrative Tools
Vendor-provided system administration tools
The various operating systems provide the following GUI and menu-driven administrative tools.
AIX:
smit, wsm
HP-UX:
sam
FreeBSD:
sysinstall
Solaris:
admintool, smc
Linux:
redhat-config-* (Red Hat); yast2 (SuSE)
chroot
chroot directory command
Change the root to the specified directory, and then execute the specified command. The command will interpret all paths as starting from the specified directory (rather than /).
date
date MMDDhhmm[CC]YY[.ss]
Set the date and time (using a 24-hour clock). For example, the argument for 1:47 p.m. on September 5, 2002 is 0905134702.
file
file files
List the types of each specified file. Identification is made based on the "magic numbers" defined in the magic configuration file (its location varies by system).
find
find starting-dirs [matching-criteria-and-actions]
Locate files that have the specified characteristics, and perform the specified actions on each file. Starting-dirs is a list of one or more directories from which to start searching. If the matching-criteria expression returns a true value; then the specified actions are carried out on the matching file.
Matching-criteria options
-atime n
The file was last accessed exactly n days ago.
-mtime n
The file was last modified exactly n days ago.
-newer file
The file was modified more recently than file.
-size n
The file is n 512-byte blocks long (rounded up to next block).
-links n
The file's inode has exactly n hard links.
-type c
Specifies the file type: f (plain file), d (directory), l (symbolic link), p (named pipe), s (socket), b (block special file), c (character special file).
-fstype type
Specifies the filesystem type.
-name fname
The filename is fname.
-perm [-]p
The file's numeric access mode is p. If the hyphen is included, then only the bits set in p are compared to the file's access mode, and all other permissions are ignored.
-user username
The file's owner is username
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Devices and Device Files
dmesg
dmesg Not available under AIX
Display boot and other system messages. Devices are listed within the messages as the devices are detected.
Vendor-specific device listing commands
AIX
lscfg                     List all devices.
lsdev -C -s scsi          List all SCSI devices.
lscfg -v -l device        Display device details.
lsattr -E -H -l device    Display device attributes.
FreeBSD
pciconf -l -v          List PCI devices.
camcontrol devlist      List SCSI devices.
usbdevs                 List USB devices.
HP-UX
ioscan -f -n            Display detailed device listing.
ioscan -f -n -C disk    Limit to device class.
Linux
lsdev          List major devices.
scsiinfo -l    List SCSI devices.
lspci          List PCI devices.
lsusb          List USB devices.
Solaris
getdev               List devices.
getdev type=class    Limit to device class.
devattr -v device    Display device detail.
In all cases, the optional r in special filenames refers to the character device (i.e., raw access mode), and the other name refers to the block device.
Disk partition special filenames
AIX
/dev/hdiskn (refers to entire disk)
n is the disk number. Example: /dev/hdisk1
FreeBSD
/dev/[r]ppnsmx (often shortened to /dev/[r]ppnx)
pp is a device-specific prefix (e.g., ad or wd for IDE disks, da for SCSI), n is the disk number, m is the slice number (physical partition), and x is the partition letter. Example: /dev/da1s1a
HP-UX
/dev/[r]dsk/cktidn
k is the controller number, i is the SCSI ID, and n is the disk number. Example: /dev/dsk/c0t4d1
Linux
/dev/[sd|hd]ym
The sd/hd prefix refers to SCSI/IDE disks, respectively, y is the disk letter (where a refers to the first disk, etc.), and m is the physical partition number. Example: /dev/hda1
Solaris
/dev/[r]dsk/cktid0sm
k is the controller number, i is the SCSI ID, and m is the physical partition number. Example: /dev/dsk/c0t4d0s2
CD-ROM device special filenames
AIX:
/dev/cd0
HP-UX:
/dev/dsk/cktid0
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
File Ownership and Protection
chmod
chmod [-R] access-string[,access-string...] files
Change the file mode of the specified files as directed in the access-string. -R operates recursively on any directories in the file list.
Access-string can be a numeric file mode or one or more symbolic permission strings; symbolic permission strings have the general syntax:
[class]+|-|=[type]
where class is one or more access class code letters: u for user, g for group, o for other, a for all. a is the default (although on some systems, omitting the access class causes the specified permissions to be limited by the current umask).
The second item is an operator: + to add permissions, - to remove them, and = to set permissions to the specified value.
Type is one or more access type code letters: r (read), x (execute), w (write), or one of the special types listed in the following section.
Special access types
X
Set execute access only if it has already been set for some access class.
t (save text mode/sticky bit) [numeric 1000]
When used for other access on a directory, restricts user file deletions to his own files.
s (SetUID and SetGID) [numeric 4000 and 2000]
When used with user and group access, causes a program to execute in the user/group context of the files's owner(s), rather than the user who ran it. Both require the corresponding execute access to be on.
SetGID access on a directory causes new file group ownership to follow the directory's group owner rather than the primary group of the creating user.
l (file locking: Solaris, some Linux) [numeric 2000]
Set mandatory file locking on reads/writes. Assign via the group access class; requires that group execute access is off.
chownchgrp
chown [-R] new-owner[:new-group] files chgrp [-R] new-group files
Change the user/group ownership of the specified files. The -R option performs a recursive operation on directories in files.
umask
umask mask
Set the default permission mode mask (the corresponding default mode is the octal compliment of mask).
AIX ACLs
acledit
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
System Messages and Log Files
File locations
syslog daemon configuration file
Usual:
/etc/syslog.conf
General message log file
Usual:
/var/log/messages
HP-UX:
/var/adm/syslog/syslog.log
Solaris:
/var/adm/messages
syslog subsystem configuration
FreeBSD:
/etc/rc.conf: syslogd_enable and syslogd_flag.
Linux:
/etc/sysconfig/syslog (SuSE): SYSLOGD_PARAMS and KERNEL_LOGLEVEL.
/etc/syslog.conf file format
facility[,facility].level[;facilities.level] dest
Facility is a list of one or more defined syslog "facilities," which are sources of system messages. Multiple facilities are separated by commas.
Level is a defined message severity level; all messages at that level and higher will be selected.
Multiple facility-level pairs may be listed, separated by semicolons. An asterisk may be used for either item; the asterisk refers to all facilities or all severity levels, except mark.
The final item is the message destination; it can be a full pathname to a file, a user or list of users to whom a message should be sent (* refers to all logged-in users), or @hostname (forward it to the syslog daemon on that host). Note that specified files must already exist.
Facilities
kern
The kernel.
user
User processes.
mail
The mail subsystem.
lpr
The printing subsystem.
daemon
System server processes.
auth
The user authentication system (nonsensitive information).
authpriv
The user authentication system (security sensitive information). Some systems have only one of auth and authpriv.
mark
Internal syslog time stamp messages (generated every 20 minutes by default).
local*
Eight local message facilities (0-7). Some operating systems define one or more of them.
Some systems define additional subsystem-specific facilities, such as ftp, news, uucp, syslog, etc.
Severity levels
emerg
System panic.
alert
Serious errors that require immediate attention.
crit
Critical errors, such as hard device errors.
err
Other errors.
warning
Warnings.
notice
Noncritical messages.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Startup and Shutdown
Booting the system manually
AIX
Little intervention is allowed. Boot from an alternate device by using the AIX bootlist command to set the device order.
FreeBSD
Select a disk and/or partition from the menu. Strike a key when prompted; then use the boot command (add -s for single-user mode). To boot an alternate kernel, use commands like:
unload
load filename
boot
HP-UX (> prompt)
List devices with the search command. Use bo xx to boot the device labeled xx in the search output (e.g., CD-ROM).
HP-UX (ISL> prompt)
Use the hpux command. Add -is (for single-user mode) and/or a pathname to boot an alternate kernel.
Linux (lilo boot loader)
The Tab key lists the boot choices; enter one choice to boot (e.g., linux). Add single to boot to single-user mode.
Linux (grub boot loader)
Use the following commands to specify all boot parameters:
grub> root (hd0,0)            Partition to boot from
grub> kernel path ro root=/dev/xdyn			 Kernel /root devs
grub> initrd path			    If needed
grub> boot 	                Initiate the boot
When specifying the root device, x is either h or s, y is the disk letter, and n is the partition number.
Solaris
Enter L1-a or Stop-a to get the ok prompt. From there, the boot command starts a boot (-s selects single-user mode). The boot cdrom command boots from CD-ROM.
System V-style run levels
0
Halted state: conditions when it is safe to turn off the power.
1
System administration/maintenance state.
S and s
Single-user mode.
2
Multiuser mode (AIX default).
3
Remote file-sharing state (HP-UX and Solaris default).
4, 7, 8, 9
Administrator-definable system states. HP-UX and Solaris do not support run levels 7 through 9.
5
Same as run level 3 but running a graphical login program on the system console (Linux default).
6
Shutdown and reboot state.
Q and q
Pseudo-state that tells init to reread its configuration file.
a, b, c
Pseudo-run levels that can be defined locally. When invoked, they cause init to run the commands in /etc/inittab without changing the current (numeric) run level.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
User Accounts
/etc/passwd
The password file
username:x:UID:GID:user-info:home-dir:login-shell
username
User account login name (generally limited to 8 characters).
x
Traditional password field, set to a fixed character (usually x) when a shadow password file is in use. AIX uses an exclamation point (!), and FreeBSD uses an asterisk (*).
UID
The user identification number.
GID
The user's primary group membership.
user-info
Conventionally, contains the user's full name and, possibly, other job-related information (e.g., office location or phone number). Up to five comma-separated subfields may be defined.
home-dir
The user's home directory.
login-shell
The program used as the command interpreter for this user. On most systems, the /etc/shells file lists the full pathnames of valid shell programs; on AIX systems, valid shells are listed in the shells field in the usw stanza of /etc/security/login.cfg:
shells = /bin/sh, /bin/csh, ...
Shadow password files
/etc/shadow (Linux and Solaris)
user:pwd:changed:minlife:maxlife:warn:inactive:expires:
user
Username (as in /etc/passwd).
pwd
Encoded password.
changed
Last password change (Unix date format).
minlife
Minimum number of days a user must keep a new password.
maxlife
Maximum password lifetime, in days.
warn
Days to warn in advance of an upcoming password expiration.
inactive
Days after password expiration that the account will be disabled.
expires
Date the account expires (Unix date format).
/etc/master.passwd (FreeBSD)
user:pwd:UID:GID:class:pwd-expire:acct-expire:user-info:...
This file, which serves as both passwd and shadow files, uses three additional fields between the GID and user information fields:
pwd
Encoded password.
class
User class (see FreeBSD user classes).
pwd-expire
Password expiration date (Unix date format).
acct-expire
Account expiration date (Unix date format).
/etc/security/passwd (AIX)
Encoded passwords are stored in the password field.
/etc/group
The group file
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Process and Resource Management
Job control
command &
Run the specified command in the background.
^Z
Stop foreground process.
jobs
List background processes.
fg [job]bg [job]
Resume the specified job in the foreground/background. job defaults to the stopped foreground job. %n refers to background job n. %?str refers to the background job whose command string contains the specified character string.
~^Z
Suspend an rlogin session. Add an additional tilde for each level of nesting (e.g., ~~^Z suspends a second-level rlogin session back to the first-level rlogin session, while ~^Z suspends the second-level session back to the local session).
ps
ps aux AIX, FreeBSD, Linux /usr/ucb/ps aux Solaris ps -elf System V version: HP-UX
Display the detailed process list. The al option to the first two commands produces a different listing, which displays the process priority and nice number.
ps output columns
USER (HP-UX: UID)
Username of the process owner
PID
Process ID
%CPU
Estimated fraction of CPU consumed (FreeBSD); CPU time/elapsed time (AIX, Solaris, Linux).
%MEM
Estimated fraction of consumed system memory
SZ
Virtual memory used, in KB (HP-UX: pages)
RSS
Physical memory used, in KB
TT (HP-UX: TTY)
TTY associated with the process
STAT (HP-UX: S)
Current process state flag(s):
R
Running or runnable
S
Sleeping
I
Idle (HP-UX: intermediate state)
T
Stopped
Z
Zombie process
D
Disk wait (not HP-UX)
X
Growing: waiting for memory (HP-UX)
K
Available kernel process (AIX)
W
Swapped out (not HP-UX)
N
Niced down (not HP-UX)
<
Niced: priority artificially raised (not HP-UX)
TIME
Total CPU time used
COMMAND
Command line being executed (truncated)
STARTED (HP-UX: STIME)
Time or date the process started
F
Flags associated with the process (see the psmanual page)
PPID
Parent's PID
NI
Process nice number
CP (HP-UX: C)
Short term CPU-use factor; used by the scheduler for computing the execution priority (PRI)
PRI
Actual execution priority (recomputed dynamically)
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Filesystems and Disks
/etc/fstab
location mount-dir fs-type dump-freq fsck-pass options
Filesystem configuration file.
special-file
Filesystem location. For traditional local filesystems, this is the partition's block special file. A logical volume may also be specified if an LVM is in use. ForNFS remote filesystems, the format is host:/path.
For Samba filesystems, the Linux format is //host/share. The FreeBSD format is //user@host/share.
mount-dir
Directory where the filesystem will be mounted.
fs-type
Filesystem type keyword.
dump-freq
Integer indicating the frequency this filesystem should be backed up by the dump utility.
fsck-pass
Integer indicating the order fsck should check filesystems.
options
Comma-separated list of options or the keyword defaults.
/etc/vfstab (Solaris)
block-dev char-dev mt-dir fs-type fsck-pass auto? opts
Similar syntax to the tradition fstab file, except:
  • Both block (for mounting) and character (for fcsk) special files are listed as the first two fields.
  • auto? is either yes or no, depending on whether the filesystem should be mounted automatically at boot time with mount -a.
  • The dump frequency field is not included.
/etc/filesystems (AIX)
mount-pt: attribute = value ...
Attributes
dev = /dev/logical-volume
Logical volume.
vol = "name"
Descriptive label.
vfs = jfs2
Filesystem type: jfs2 for local, nfs for NFS.
log = /dev/log-vol
Device to use for filesystem log.
mount = true|false
Mount automatically?
check = n
Sets the fsck pass.
options = list
Mount options.
quota = keywords
userquota and groupquota enable user and group disk quotas.
Filesystem types
Local
AIX:
jfs2
FreeBSD:
ufsHP-UX: vxfs, hfs
Linux:
ext2, ext3, reiserfs
Solaris:
ufs
CD-ROM
AIX:
cdrfs
FreeBSD:
cd9660HP-UX: cdfs
Linux:
iso9660
Solaris:
hsfs
DOS
FreeBSD:
msdos
Linux:
msdos
Solaris:
pcfs
Samba
FreeBSD:
smbfs
Linux:
smbfs
Filesystem mounting options
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Printing
Printing subsystem components
Spool directories
AIX:
/var/spool/lpd/qdir and /var/spool/qdaemon
FreeBSD:
/var/spool/output/lpd/*
HP-UX:
/var/spool/lp/request/*
Linux:
/var/spool/lpd/*
Solaris:
/var/spool/lp/requests/*
Configuration file(s)
AIX:
/etc/qconfig
FreeBSD:
/etc/printcap
HP-UX:
/etc/lp/*
Linux:
/etc/printcap
Solaris:
/etc/lp/* and /etc/printers.conf
Boot script configuration
FreeBSD:
/etc/rc.conf: lpd_enable="YES"
HP-UX:
/etc/rc.config.d/lp: LP=1
SuSE Linux:
/etc/sysconfig/printer: DEFAULT_PRINTER=name
Used by FreeBSD and some Linux systems.
lpq
lpq [-P printer | -a]
List the contents of the default queue (no options), specified queue, or all queues.
lprm
lprm [-P printer] list
Remove print jobs from a queue. list can contain print-job IDs and/or usernames (remove all jobs owned by the specified user); if list is a single hyphen, all jobs are removed from the specified queue.
lpc
lpc [subcommand args]
Administrative utility. Executes the specified subcommand, or enters interactive mode if no subcommand is specified.
Subcommands
status printer
Display status of the line printer daemon and the specified print queue.
start printer
Restart printing on the printer after an abort or stop command.
stop printer
Stop all printing on printer after the current job has finished (new jobs are still accepted).
abort printer
Stop all printing on printer immediately (new jobs are still accepted).
clean printer
Remove all jobs from the printer's queue. The current job will still complete.
disable printer
Prevent users from adding new jobs to the specified queue (printing continues).
enable printer
Allow users to spool jobs to the queue.
down printer
Stop printing and disable the queue for printer (disable plus stop).
up printer
Enable the queue and start printing on printer (enable plus start).
topq printer job-ID
Move the specified job to the top of the queue.
LPRng enhancements to lpc
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Serial Lines
Termcap/terminfo file
AIX:
/usr/lib/terminfo
FreeBSD:
/etc/termcap (a link to /usr/share/misc/termcap)
Linux:
/etc/termcap and /usr/share/terminfo
HP-UX:
/usr/lib/terminfo (a link to /usr/share/lib/terminfo)
Solaris:
/etc/termcap and /usr/share/lib/terminfo
stty
stty options [value] ...
Modify serial line settings.
Options
n
Baud rate.
rows n
Lines on the screen.
columns n
Columns on the screen.
[-]echo
Echo/don't echo typed characters on the screen.
erase c
Delete the previous character.
kill c
Erase the entire command line.
intr c
Interrupt the foreground command.
eof c
End-of-file signal.
susp c
Suspend the foreground command.
lnext c
Interpret the next character literally (used to insert control characters into the command line).
werase c
Erase the previous word.
rprnt c
Reprint the pending command line.
stop c
Pause terminal input and output.
start c
Restart a paused terminal.
flush c
Discard all pending (undisplayed) output.
quit c
Kill the foreground command and dump core.
oddp
Enable odd parity.
evenp
Enable even parity.
-parity
No parity is generated or detected.
cstopb
Use two stop bits (-cstopb means one stop bit).
clocal
Use a hard carrier (-clocal means soft).
sane
Reset many options to reasonable settings.
/etc/ttys (FreeBSD)
port command type [flags]
port
Special file in /dev that communicates with this serial line.
"command"
getty command init should run for this serial line.
type
Terminal type (from /etc/termcap), the network keyword (for pseudo terminals), or dialin (for dial-up modems).
flags
Keywords, separated by spaces:
on|off		Is line enabled?
secure		Allow root logins.
window=cmd	init should run cmd before the command in field 2.
group=name	Define group of teminals for /etc/login.conf.
/etc/inittab (AIX, HP-UX, Linux, Solaris)
Terminal-related entries have a gettycommand as their final field (see Section for more about the inittab file).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Networking
ifconfig
ifconfig lo0 localhost up ifconfig interface ip-address netmask mask
The first form configures the loopback interface. The second form assigns the specified IPv4 address and subnet mask to interface. FreeBSD and Solaris allow you to replace the address and netmask parameters (including the keywords) with a CIDR address.
Displaying information about network interfaces
ifconfig [options] [interface]
Display the configuration of the specified interface(s).
-a
Display data for all interfaces (not supported by HP-UX).
-l (FreeBSD and AIX)
List all network interfaces.
Network interface configuration files
AIX
Stored in the ODM; modify with mktcpip or SMIT.
FreeBSD
/etc/rc.conf:
hostname="name"
ifconfig_iface="ip-addr netmask mask" 
HP-UX
/etc/rc.config.d/netconf:
HOSTNAME="name" 
INTERFACE_NAME[n]=name
IP_ADDRESS[n]=addr
SUBNET_MASK[n]=mask
INTERFACE_STATE[n]=up|down
n is the interface number (starting at 0).
Linux
/etc/sysconfig/networking/devices/ifcfg-ethn Red Hat
/etc/sysconfig/network/ifcfg-ethn SuSE
DEVICE=name 		Red Hat
BOOTPROTO=static|dhcp
IPADDR=addr
NETMASK=mask
ONBOOT=yes|no 				Red Hat only
STARTMODE=yes|no 		        SuSE only
/etc/sysconfig/network: Red Hat
HOSTNAME="name"					
/etc/HOSTNAME:
Holds the hostname (SuSE).
Solaris
/etc/hostname.iface:
The first line holds the hostname. Any additional line(s) hold ifconfig command arguments (optional).
Displaying the system's MAC address
AIX:
entstat adapter
HP-UX:
lanscan
FreeBSD, Linux, Solaris:
ifconfig interface
CIDR suffixes and subnet masks
Suffix
Subnet mask
Max. hosts
/22
255.255.252.0
1022
/23
255.255.254.0
510
/24
255.255.255.0
254
/25
255.255.255.128
126
/26
255.255.255.192
62
/27
255.255.255.224
30
/28
255.255.255.240
14
/29
255.255.255.248
6
/30
255.255.255.252
2
Important services and their associated ports
Unless otherwise noted,services are assigned to both the TCP and UPD ports; port numbers followed by an "s" are used by the secure version of the service.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Electronic Mail
/etc/aliases file
alias: name [name ...]
Define a mail alias as the specified list of user(s) and/or other aliases. Aliases can be nested. An initial backslash defines a terminal alias (not subject to further expansion).
This file is stored in /etc/mail/aliases under FreeBSD and HP-UX.
File/directory locations
Boot script configuration file
FreeBSD
/etc/rc.conf:
sendmail_enable="YES"
HP-UX
/etc/rc.config.d/mailservs:
export SENDMAIL_SERVER=1
Linux
/etc/sysconfig/sendmail:
START_SENDMAIL="yes"
Solaris
/etc/default/sendmail:
DAEMON=yes
sendmail.cf directory
Usual:
/etc/mail
AIX:
/etc
Linux:
/etc
Configuration file build area
AIX:
/usr/samples/tcpip/sendmail/cf
FreeBSD:
/usr/share/sendmail/cf/cf
HP-UX:
/usr/newconfig/etc/mail/cf/cf
Linux:
/usr/share/sendmail-cf/cf (Red Hat) /usr/share/sendmail/cf (SuSE)
Solaris: