Synopses & Reviews
Written by best-selling author Mark G. Sobell,
A Practical Guide to Solaris enables both novice and experienced users to quickly learn Sun Microsystems' popular Solaris operating system. Designed to maximize accessibility, the book is divided into three parts. Part I is a tutorial that brings novice users--those with no UNIX/Solaris background, or no programming experience at all--quickly up to speed. Part II is geared toward intermediate and advanced users. Part III is a comprehensive reference guide covering more than ninety Solaris utilities with a clarity of explanation and range of examples not available from any other source.
A Practical Guide to Solaris provides invaluable information on the following:
- Solaris 7 (a.k.a. Solaris 2.7), as well as Solaris 2.6 and earlier versions for Intel and SPARC hardware. For beginning and experienced end users and C and shell programmers using either a command line or GUI interface.
- Graphical User Interfaces (GUIs). Learning and using the X Window System and the CDE and OpenLook desktop managers. Offers extensive discussions of CDE and X customization.
- Networking, the Internet, and the World Wide Web. Explains what a network is, how it works, and how you can use it. Discusses types of networks, network implementations, distributed computing, how to use the network for communicating with other users, and using various networking utilities (such as rcp, telnet, ftp, nslookup, and more).
- Shells. Describes how to use the Bourne (sh), C (csh), and Korn (ksh) Shells as interactive command interpreters and as programming languages so you can write shell scripts. Extensive coverage of builtin commands, shell variables, options, customization, functions, and programming techniques.
- System Administration. Covers system operation from SPARC PROM mode/booting an Intel x86 through multiuser mode; types of files, including
- symbolic links and special files; adding and removing users, printers, devices and drivers; installing software, sharing and backing up filesystems, network services, system reports (sar, iostat, and more) and admintool; installing patches and system software; and problem solving.
- Programming Tools and Concepts. Covers both the Solaris (cc) and GNU (gcc) C compilers, debugging (lint and gcc warnings), shared libraries, make, SCCS, and more.
These essential topics are presented in a clear, easy-to-understand format with the help of the following:
- Examples. Both interactive and shell script examples are used throughout Parts I and II to provide added insight into Solaris features. Part III includes examples of more than ninety Solaris utilities.
- Tutorials. Step-by-step tutorials cover the vi, dtpad (CDE), and textedit (OpenLook) text editors; the dtmail (CDE), mailtool (OpenLook), and pine mail programs; the pine and Netscape newsreaders; the Netscape browser; and how to use a search engine. All tutorials are illustrated with real-world examples so you can practice as you read.
- Appendixes and Glossary. These cover regular expressions, POSIX standards, and security. The Help! appendix provides assistance on using your hardware and for locating, downloading, and installing Sun, public, and GNU software (including gzip and gcc).
- A Web site (www.sobell.com). Maintained by the author, this site provides help in locating Solaris documentation, software, patches, and free items, as well as corrections to, and downloadable examples from, this book.
020189548XB04062001
Review
"This book seems to be the perfect reference to move novices into Solaris quickly. It can be used to train people new to Unix on Solaris and provide a very good starting point for those moving over from another flavor of Unix. Most books on Unix focus on either being a tutorial for new users or being a reference manual for users familiar with some flavor of Unix. There is very little that covers the middle ground and almost none that cover all three levels. I know of no other book positioned in a way that can take a relative novice to performing basic system administration in a minimal amount of time."-- Rik Schneider, Sr. Systems Administrator, SkyLynx Communications Inc.
Review
"This is one of the best books I've seen on Solaris, and UNIX in general. The book will be useful after the first read, as a very good, and very concise reference book. It has all the aspects of a good textbook, and at the same time it is organized to be an effective reference after the fact." -- Charles A. Plater, Wayne State University
PREFACE: PREFACE
This book is practical because it uses tutorial examples that show you what you will see on your terminal, workstation, or terminal emulator screen each step of the way. It is a guide because it takes you from logging in on your system (Chapter 2) through writing complex shell programs (Chapters 11, 12, and 13), using sophisticated software development tools (Chapter 14), and administrating a system (Chapter 15). Part III is a reference guide to more than 90 Solaris utilities. This Practical Guide is intended for people with some computer experience but little or no experience with a Solaris/UNIX system. However, more experienced Solaris/UNIX system users will find Parts II and III to be useful sources of information on subjects such as GUIs, basic and advanced shell programming, editing, C programming, debugging, source code management, networks, the Internet, the World Wide Web, and Solaris system administration.
AUDIENCE
This book appeals to a wide range of readers. As a minimum it assumes some experience with a PC or a Mac, but it does not require any programming experience. It is appropriate for
- Users of both single- and multiuser Solaris systems
- Students taking a class about Solaris
- Students taking any class in which they use Solaris
- Computer science students studying the Solaris Operating System
- People who want to run Solaris at home
- Professionals who want to use Solaris at work
- Programmers who need to understand the Solaris programming environment
BENEFITS
You will come away from this book with a broad knowledge of Solaris and how to use it in day-to-day work. Whether you are a C or Shell programmer or a user who wants to run application programs, this book will give you the knowledge to proceed. A Practical Guide to Solaris gives you a broad understanding of Solaris, including how to administer, maintain, and update the system. It will remain a valuable reference tool for years to come.
SCOPE OF COVERAGE AND FEATURES
A Practical Guide to Solaris covers a wide range of topics, from writing simple shell scripts to recursive shell programming; from local email to using Netscape to browse the World Wide Web; from using simple utilities to source code management using SCCS; from using a system to administrating one. The following section highlights some of the features of this book and is followed by more in-depth discussions of some of these features.
FEATURES
- Full coverage of Suns GUIs: Common Desktop Environment (CDE) and OpenLook Window Manager (olwm)
- Tutorials on key topics (vi, CDE editor, Netscape, and more)
- Discusses terminal emulation (logging in from a PC or other emulator)
- Appendixes covering:
/ Regular expressions
/ Help: covers finding and downloading software, login information, basic GUI information
/ Security
/ POSIX
- Covers important GNU tools such as gcc and gzip
- Covers the emacs and vi editors (one complete chapter on each)
- Part III covers the use of over 90 utilities including many examples
SOLARIS
- Compatible with all releases of Solaris 2.x through System 7 (Solaris 2.7)
- A complete discussion of the Solaris filesystem
- A discussion of the SPARC PROM Mode
- Coverage of both the Intel (x86) and SPARC versions of Solaris
- Discusses SPARC and x86 (Intel) Boot procedures
- Covers both the CDE and OpenLook GUI interfaces
- Covers AnswerBook2 including installation and running from the CDROM (System 7 only)
INTERNET
- Broad Internet coverage including Netscape, ftp, downloading software and documentation using a search engine, and constructing a simple HTML page
- Complete instructions on obtaining and using free software: finding, downloading (using Netscape or ftp), decompressing, compiling, and installing software from the Internet
- Guidance on using ping, whois, nslookup, traceroute, and more
- Getting online documentation from many sources (local and Internet)
TUTORIALS
- vi editor
- dtmail mail program (CDE)
- mailtool mail program (Open Look)
- dtpad text editor (CDE)
- textedit text editor (Open Look)
- pine as a mail program
- pine as a newsreader
- Netscape as browser
- Netscape as a newsreader
- How to use a search engine
ASSISTANCE
- Many examples throughout
- Comprehensive index
- Caution boxes warn you of the consequences of taking certain actions
- Security boxes caution you where security may be breached
- Tip boxes give you helpful hints
- Appendix B, Help!, written in FAQ style covers (partial list):
/ Internet addresses of where you can obtain additional software (some free)
/ Downloading software from the Internet
/ Decompressing, compiling, and installing software obtained from the Internet
/ Basic login and GUI information to help you get started
/ Setting up special keyboard keys
THE SHELLS
- Thorough shell coverage including an introductory shell chapter as well as chapters on the Bourne Shell (sh), the C Shell (csh), and the Korn Shell (ksh). Coverage includes both interactive use of the shells and programming.
- Korn Shell coverage of the coprocess, with examples
THE X WINDOW SYSTEM
- Window managers
- Bringing up and shutting down the X Window System
- Setting X resources
- Using the X Window System
- Customizing the X Window System
- Remote Computing and Local Displays
COMMON DESKTOP ENVIRONMENT (CDE)
- Desktop Manager
- Window Manager (dtwm)
- Creating and using Actions
- File Manager (dtfile)
- Front panel use and customization
- Editing (dtpad)
- Mail (dtmail)
- Building Menus (dtwm)
- Windows
- Terminal emulation
- Style Manager
- Login Manager
- Initialization files used to customize CDE
OPENLOOK WINDOW MANAGER (OLWM)
- Workspace Menu
- File Manager
- Customizing the desktop
- Help viewer
- Customizing menus
SYSTEM ADMINISTRATION
- Using pkginfo, pkgadd, and pkgrm to add/remove software packages
- Adding and removing users
- Using patchadd/installpatch to install patches to the system
- Adding local and remote printers
- Installing AnswerBook2
- Using admintool for system administration
- Using ufsdump and ufsrestore to back up and restore files
- Sharing files with other machines (RFS, NFS)
- Coverage of ACL (Access Control List) permissions
- Security issues
- The PROCFS filesystem
- Configuring and booting the system (both SPARC and x86)
- Adding and removing devices and drivers
- Performing a reconfigure reboot
- Disk capacity planning and partitioning
- Setting up network files
- Running system reports (sar, iostat, vmstat, netstat, mpstat, top)
PROGRAMMING ENVIRONMENT
- Using SCCS (source code management)
- Using make
- Using the Sun C compiler (cc) as well as the GNU C compiler (gcc)
- Using both the dbx and gdb debuggers
- Using shared libraries
PARTS I, II, AND III
A Practical Guide to Solaris shows you how to use Solaris from your terminal. Part I comprises Chapters 1 through 5, which introduce the new user to Solaris: introduction, getting started, basic utilities, filesystem structure, and the shell. Part I contains step-by-step tutorials covering the most important aspects of the Solaris operating system.
Part II comprises Chapters 6 through 15, which cover intermediate and advanced aspects of Solaris: GUI interfaces, networking, the vi and emacs editors, the Bourne, C, and Korn Shells and shell scripts, programming, and system administration.
Part III offers a comprehensive, detailed reference to more than 90 Solaris utilities, with numerous examples. If you are already familiar with the Solaris/UNIX system, this part of the book will be a valuable, easy-to-use reference. If you are not an experienced user, you will find Part III a useful supplement while you are mastering the subjects and tutorials in Parts I and II.
If you have used a Solaris/UNIX system before, you may want to skim over Chapters 2 and 3 or even all of Part I.
The more advanced material in each chapter is presented in sections marked Optional, which you are encouraged to return to after mastering the more basic material presented in the chapter. Review exercises are included at the end of each chapter for readers who want to hone their skills. Some of the exercises test the readers understanding of material covered in the chapter, while others challenge the reader to go beyond the material presented to develop a more thorough understanding.
ORGANIZING INFORMATION
In Chapters 2, 3, and 4, you will learn how to create, delete, copy, move, and search for information using Solaris utilities. You will also learn how to use the Solaris file structure to organize the information you store on your computer.
ELECTRONIC MAIL AND TELECOMMUNICATIONS
Chapters 2 and 3 and Part III include information on how to use utilities (pine, talk, write, and the graphical mail programs dtmail and mailtool) to communicate with users on your system and other systems. Chapter 7 details how to address electronic mail to users on remote, networked systems.
USING THE SHELL
Chapter 5 shows you how to redirect output from a program to the printer, to your terminal, or to a filejust by changing a command. You will also see how you can use pipes to combine utilities to solve problems right from the command line.
ADVANCED SHELL COVERAGE INCLUDING SHELL PROGRAMMING
Once you have mastered the basics of Solaris, you can use your knowledge to build more complex and specialized programs using a shell programming language (shell scripts). Chapter 10 picks up where Chapter 5 leaves off. It covers more advanced aspects of working with a shell, using the Bourne Shell for examples. Chapter 11 shows you how to use the Bourne Shell to write scripts composed of Solaris system commands. Chapter 12 covers the C Shell. Chapter 13 covers the Korn Shell, which combines many of the popular features of the C Shell (such as history and aliases) with a programming language similar to that of the Bourne Shell. This chapter also covers many concepts of advanced shell programming. The examples in Part III also demonstrate many features of the utilities you can use in shell scripts.
USING PROGRAMMING TOOLS
Chapter 14 introduces you to Solariss exceptional programming environment. This chapter describes how to use some of the most useful software development tools: cc (Solaris C compiler), gcc (the GNU C compiler), make, the Source Code Control System (SCCS), and the dbx and gdb debuggers. The make utility automates much of the drudgery involved in ensuring that a program you compile contains the latest versions of all program modules. SCCS help you to track the versions of files involved in a project. The dbx and gdb debuggers help you get your programs running correctly.
NETWORKING, THE INTERNET, AND THE WORLD WIDE WEB
Chapter 7 explains what a network is, how it works, and how you can use it. It tells you about types of networks, various network implementations, distributed computing, how to use the network for communicating with other users, and using various networking utilities (such as rcp, telnet, ftp, pine, nslookup, and more). This chapter also discusses the use of the Internet and shows, with examples, how to use a browser (Netscape) and a search engine (AltaVista) and how to create a very simple page on the Web.
GRAPHICAL USER INTERFACES (GUIS)
Chapter 6 discusses the X Window system, how to open and control windows, how to customize your X work environment, and how to use and customize the CDE and OpenLook window managers.
THE KORN SHELL AND ADVANCED SHELL PROGRAMMING
Chapter 13 covers many of the features of this powerful shell. It extends the concepts of shell programming introduced in Chapter 11 into more advanced areas, including more information on the locality of variables, recursion, and the coprocess.
THE VI EDITOR
The screen-oriented vi editor, which was originally a part of Berkeley UNIX, is still one of the most widely used text editors. Chapter 8 starts with a tutorial on vi and goes on to explain how to use many of the advanced features of vi, including special characters in search strings, the general-purpose and named buffers, parameters, markers, and executing commands from vi. The chapter concludes with a summary of vi commands.
THE EMACS EDITOR
Produced and distributed (for minimal cost) by the Free Software Foundation, the GNU emacs editor has grown in popularity and is available for Solaris. Chapter 9 includes information on emacs versions 19 and above and the X Window System, allowing you to use a mouse and take advantage of X Window System features such as cut and paste with emacs. This chapter explains how to use many of the features of this versatile editor, from a basic orientation to the use of the META, ALT, and ESCAPE keys; key bindings, buffers, the concept of Point, the cursor, Mark, and Region, incremental and complete searching for both character strings and regular expressions; using the online help facilities, cutting and pasting (from the keyboard and with a mouse), and using multiple windows; and C Mode, which is designed to aid a programmer in writing and debugging C code. The chapter concludes with a summary of emacs commands.
JOB CONTROL
The job control commands, which originated on Berkeley UNIX, allow a user to work on many jobs at once from a single window, and switch back and forth between the jobs as desired. Job control is available under the Job, C, and Korn Shells.
SHELL FUNCTIONS
A feature of the Bourne and Korn Shells, shell functions enable you to write your own commands that are similar to the aliases provided by the C Shell, only more powerful.
SOURCE CODE MANAGEMENT: SCM
The Source Code Control System is a convenient set of tools that enables programmers to track multiple versions of files on a number of different types of projects.
POSIX
The IEEE POSIX committees have developed standards for programming and user interfaces based on historical UNIX practice, and new standards are under development. Appendix D describes these standards and their direction and effect on the UNIX industry.
SYSTEM ADMINISTRATION
Chapter 15 explains the inner workings of the Solaris system. It details the responsibilities of the Superuser and explains how to bring up and shut down a Solaris system, add users to the system, back up files, set up new devices, check the integrity of a filesystem, and more. This chapter goes into detail about the structure of a filesystem and explains what administrative information is kept in the various files.
USING UTILITIES
The Solaris system includes hundreds of utilities. Part III contains extensive examples of how to use many of these utilities to solve problems without resorting to programming in C (or another language). The example sections of nawk (over 20 pages, starting on page 820) and sort (page 891) give real-life examples that demonstrate how to use these utilities alone and with other utilities to generate reports, summarize data, and extract information.
REGULAR EXPRESSIONS
Many UNIX utilities allow you to use regular expressions to make your job easier. Appendix A explains how to use regular expressions, so that you can take advantage of some of the hidden power of your Solaris system.
SUPPLEMENTS
The author's home page (www.sobell.com) contains downloadable listings of the longer programs from the book; current pointers to many interesting and useful Solaris sites on the World Wide Web; a list of corrections to the book; and a solicitation for corrections, comments, suggestions, and additional programs and exercises.
Synopsis
Both beginners and experienced users can gain knowledge and develop the skills to use the Sun Microsystems version of the UNIX operating system. An excellent on-going resource for reference, this book requires no programming experience.
About the Author
Mark G. Sobell is president of Sobell Associates Inc., a consulting firm that specializes in UNIX/Linux training, support, and custom software development. He is the author of many best-selling UNIX and Linux books and has more than twenty-five years of experience working with UNIX and Linux.
Table of Contents
Preface Audience
Benefits xlv
Scope of Coverage and Features
Parts I, II, and III
Supplements
Thanks
Part I
Introduction to Solaris
Chapter 1
The Solaris Operating System
The Heritage of UNIX
Whats So Good about Solaris?
System Features
Standards
Binary Compatibility
The Standardization of UNIX
How Can UNIX Run on Different Computers/Processors?
The C Programming Language
Overview of Solaris
Solaris Has a Kernel Programming Interface
Supports Many Tasks at One Time
Supports Many Users at One Time
Solaris Provides a Hierarchical Filesystem with Builtin Security
The Shell Is a Command Interpreter and Programming Language
8
Filename Generation
Device-Independent Input and Output
Shell Functions
Job Control
A Large Collection of Useful Utilities
Interprocess Communication
System Administration
Additional Features of Solaris
Graphical User Interfaces
(Inter)networking Utilities
Software Development
Screen-Oriented and Graphical Editors
Advanced Electronic Mail
GNU/FSF
Summary
Review Exercises
Chapter 2
Getting Started
Before You Start
Name and Version of the Operating System
Conventions
Keys and Characters
Utility Names
Filenames
Shell and Builtin and Variable Names
Items You Enter
Prompts and RETURNs
Optional Information
Solaris2 Designation
Logging In
Graphical User Interface (GUI)
Character-Based Interface
Incorrect Login
The Shell
Logging Out
Terminal Emulation and telnet
Superuser
Correcting Mistakes
Erasing a Character
Deleting a Word
Deleting a Line
Aborting Execution
passwd: Changing Your Password
Documentation
AnswerBook2
man and xman: Displaying the System Manual
Editing a File
Tutorial: dtpad: Creating and Editing a File
Correcting Mistakes
Moving the Cursor
Highlighting Text
Saving a File
Ending an Editing Session
Tutorial: textedit: Creating and Editing a File
Getting Started
Correcting Mistakes
Moving the Cursor
Highlighting Text
Saving a File
Ending an Editing Session
Basic Utilities
ls: Listing the Contents of a Directory
cat: Displaying a Text File
pg or more: Displaying a Long Text File
rm: Deleting a File
hostname: Displaying a Machine Name
Quoting Special Characters
Summary
Review Exercises
Advanced Review Exercises
Chapter 3
The Solaris Utilities
Working with Files
cp: Copy a File
mv: Change the Name of a File
lp: Print a File
grep: Find a String
head: Display the Beginning of a File
tail: Display the End of a File
sort: Display a File in Order
uniq: Remove Duplicate Lines in a File
diff: Compare Two Files
file: Test the Contents of a File
unix2dos: Convert Solaris Files to DOS/Windows Format
Three Useful Utilities
echo: Display Text
date: Display the Time and Date
script: Record a Solaris Session
Compressing and Archiving Files
compress: Shrink a File
uncompress, zcat: Expand a File
tar: Pack and Unpack a File
Locating Commands
which, whereis: Locate Utilities
apropos: Search for Keywords
Obtaining User and System Information
who: List Users on the System
finger: List Users on the System
w: List Users
Communicating with Other Users
write: Send a Message
talk: Communicate with Another User
mesg: Deny or Accept Messages
Electronic Mail
Similarities between dtmail and mailtool
Tutorial: Using dtmail or mailtool to Send
and Receive Electronic Mail
Reading Mail
Sending Mail
Header
Alias
Tutorial: Using pine to Send and Receive
Electronic Mail
Getting Started
Sending Mail
Receiving Mail
Sending Mail to More Than One Person
Network Addresses
Summary
Review Exercises
Advanced Review Exercises
Chapter 4
The Solaris Filesystem
The Hierarchical Filesystem
Using the Hierarchical Filesystem
Directory and Ordinary Files
Filenames
Filename Extensions
Invisible Filenames
mkdir: Create a Directory
cd: Change to Another Working Directory
The Working Directory
Significance of the Working Directory
Your Home Directory
Startup Files
Absolute Pathnames
Relative Pathnames
The . and .. Directory Entries
Important Standard Directories and Files
Working with Directories
rmdir: Delete a Directory
Using Pathnames
Special Pathnames
mv, cp: Move or Copy a File
mv: Move a Directory
Access Permissions
ls l: Display Permissions
chmod: Change Access Permissions
Setuid and Setgid Permissions
Directory Access Permissions
Links
ln: Create a Link
cp versus ln
Symbolic Links
Creating a Symbolic Link
Using Symbolic Links to Change Directories
Symbolically Linked Directories under the Bourne and C Shells
Symbolically Linked Directories under the Korn Shell
rm: Remove a Link
Summary
Review Exercises
Advanced Review Exercises
Chapter 5
The Shell I
The Command Line
Syntax
Command Name
Arguments
Options
Processing the Command Line
Executing the Command Line
Standard Input and Standard Output
The Window/Terminal as a File
The Window/Terminal as Standard Input and Standard Output
107
Redirection
Redirecting Standard Output
Redirecting Standard Input
Appending Standard Output to a File
/dev/null
Pipes
Filters
tee: Sending Output in Two Directions
Running a Program in the Background
Filename Generation/Pathname Expansion
The ? Special Character
The k Special Character
The [] Special Characters
Summary
Review Exercises
Advanced Review Exercises
Part II
Intermediate/Advanced Solaris
Chapter 6
Graphical User Interfaces
What Is a GUI?
Using a GUI
Logging In
Menus
Dialog Boxes
Screen Layout
Window Manager
Desktop Manager
Workspace Manager
CDE Desktop Manager
Front Panel
Title Bar
Common OperationsMenus
Window Menu
Workspace Menu
Logging Out
Working with Windows
Closing a Window
Opening a Terminal Emulator Window
Moving a Window
Resizing a Window
Raising and Lowering Windows
Scrolling Text
Motif Scroll Bar
Athena Scroll Bar
OpenLook Scroll Bar
Using Icons
File Manager
The View Menu
The View/Set View Options Window
Properties
Copying and Pasting Text
X Window System
X Window System Window Managers
X Window System and Solaris
Bringing Up the X Server
Remote Computing and Local Displays
Local X Server, Remote Display
Local Display, Remote X Server
Stopping the X Server
Customizing Your X Work Environment
Remapping Mouse Buttons
Customizing X Applications on the Command
Line
Setting X Resources
Customizing CDE
Style Manager Tools
Color Window
Font Window
Backdrop Window
Keyboard Window
Mouse Window
Beep Window
Screen Window
Window Window
Startup Window
.dtprofile
Building Menus
Actions
Front Panel
Login Manager
Session Manager
Initialization Files
Login Screen
Issuing Commands before and after the Session
Session Setup
OpenLook Window Manager
Workspace Menu
File Manager
Customizing the Desktop
Saving the Desktop
Help Viewer
Customizing Menus
Application Preferences
X Applications
Summary
Review Exercises
Chapter 7
Networking and the Internet
Network Services
Intranets
Common Types of Networks
Local Area Networks (LANs)
Ethernet
Wide Area Networks (WANs)
Internetworking through Gateways and Routers
Network Protocols
Host Addresses
Subnets
Communicating over the Network
finger: Learn about Remote Users
Sending Mail to a Remote User
talk: with a Remote User
Mailing List Servers
Networking Utilities
ping: Test a Network Connection
rlogin, telnet: Access a Remote Computer
Trusted Hosts and the .rhosts File
rcp, ftp: Transfer Files over a Network
Anonymous ftp
rsh: Run a Command Remotely
traceroute: Trace a Route over the Internet
rwho: List Users on Remote Computers
nslookup: Query Internet Name Servers
whois: Look Up a User on the Internet
Distributed Computing
The Client/Server Model
Overview of Domain Name Service (DNS)
Network Information Service (NIS)
Network File System (NFS)
automount: Automatic Filesystem Mounting
Network Services/Daemons
USENET
Tutorial: Using pine as a Newsreader
Subscribing to Newsgroups
Reading News
Posting News
Unsubscribing from Newsgroups
Overview of the World Wide Web
Tutorial: Using Netscape
Screen Elements
Navigating the Web
Reading Netnews
Downloading Files
Using Bookmarks
Using a Search Engine
Other WWW Browsers
More about URLs
Creating Your Own Web Page
Summary
Advanced Review Exercises
Chapter 8
The vi Editor
History
Tutorial: Using vi to Create
and Edit a File
Specifying a Terminal
Starting vi
Command and Input Modes
Entering Text
Ending the Editing Session
Introduction to vi Features
Modes of Operation
The Display
The Status Line
Redrawing the Screen
The Tilde (~) Symbol
Correcting Text as You Insert It
Command Case
The Work Buffer
Line Length and File Size
Abnormal Termination of an Editing Session
Recovering Text after a Crash
Command ModeMoving the Cursor
Moving the Cursor by Characters
Moving the Cursor by Words
Moving the Cursor by Lines
Moving the Cursor by Sentences and Paragraphs
Moving the Cursor within the Screen
Viewing Different Parts of the Work Buffer
Input Mode
The Insert Commands
The Append Commands
The Open Commands
The Replace Commands
The Quote Command
Command ModeDeleting and Changing Text
The Undo Command
The Delete Character Command
The Delete Command
The Change Command
The Substitute Command
The Case Command
Searching and Substituting
Searching for a Character
Searching for a String
Special Characters in Search Strings
Substituting One String for Another
The Substitute Address
The Search and Replace Strings
Miscellaneous Commands
The Yank, Put, and Delete Commands
The General-Purpose Buffer
The Yank Command
The Put Commands
The Delete Commands
The Named Buffers
The Numbered Buffers
Reading and Writing Files
The Read Command
The Write Command
Identifying the Current File
Setting Parameters
Setting Parameters from vi
Setting Parameters in a Startup File
Setting Parameters in the .exrc Startup File
Parameters
Advanced Editing Techniques
Using Markers
Editing Other Files
Macros and Shortcuts
Executing Shell Commands from vi
Units of Measure
Character
Word
Blank-Delimited Word
Line
Screen
Repeat Factor
Summary
Review Exercises
Advanced Review Exercises
Chapter 9
The emacs Editor
About emacs
emacs versus vi
Tutorial: Getting Started with emacs
Starting emacs
Stopping emacs
Inserting Text
Moving the Cursor
Moving the Cursor by Characters
Moving the Cursor by Words
Moving the Cursor by Lines
Moving the Cursor by Sentences, Paragraphs,
and Window Position
Editing at the Cursor Position
Saving and Retrieving the Buffer
Basic Editing Commands
Keys: Notation and Use
Key Sequences and Commands
Running a Command without a Key Binding: META-x
Numeric Arguments
Point and the Cursor
Scrolling through a Buffer
Erasing Text
Searching
Incremental Searches
Nonincremental Searches
Regular Expression Searches
Online Help
Advanced Editing Topics
Undoing Changes
Mark and Region
Cutting and Pasting: Yanking Killed Text
Inserting Special Characters
Global Buffer Commands
Line-Oriented Operations
Unconditional and Interactive Replacement
Working with Files
Visiting Files
Saving Files
Working with Buffers
Working with Windows
Window Creation by Splitting
Manipulating Windows
Other-Window Display
Adjusting and Deleting Windows
Foreground Shell Commands
Background Shell Commands
Language-Sensitive Editing
Selecting a Major Mode
Human-Language Modes
Working with Words
Working with Sentences
Working with Paragraphs
Filling
Case Conversion
Text Mode
C Mode
Working with Expressions
Function Definitions
Indention
Customizing Indention for Versions 19 and Above
Comment Handling
Special-Purpose Modes
Shell Mode
Customizing emacs
The .emacs Startup File
Remapping Keys
A Sample .emacs File for Versions 19 and Above
emacs and the X Window System
Mouse Commands for Cut and Paste
Mouse-2 Selections
Scroll Bars
Manipulating Windows with the Mouse
Frame Management
Manipulating Frames
Switching to Another Frame
Menu Bars
Resources for emacs
USENET emacs FAQ (Frequently Asked Questions)
Access to emacs
Summary
Review Exercises
Advanced Review Exercises
Chapter 10
The Shell II (sh)
Bourne Shell Background
POSIX Shells
Creating a Simple Shell Script
chmod: Make a File Executable
Command Separation and Grouping
; and NEWLINE: Separate Commands
\: Continue a Command
| and &: Separate Commands and Do Something Else
(): Group Commands
Redirecting Standard Error
Job Control
jobs: List Jobs
fg: Bring a Job to the Foreground
bg: Put a Job into the Background
Processes
Process Structure
Process Identification
Executing a Command
Invoking a Shell Script
#!: Specify a Shell
#: Make a Comment
Startup Files
Parameters and Variables
User-Created Variables
unset: Remove a Variable
readonly: Make a Variable Permanent
export: Make Variables Global
read: Accept User Input
` ...`: Substitute the Output of a Command
Keyword Variables
HOME: Locate Your Home Directory
PATH: Where to Find Programs
MAIL: Where Mail Is Kept
PS1: Prompt the User (Primary)
PS2: Prompt the User (Secondary)
IFS: Separate Input Fields
CDPATH: Broaden the Scope of cd
Running .profile with the . (Dot) Builtin
Positional Parameters
$0: Name of the Calling Program
$1$9: Command-Line Arguments
shift: Promote Command-Line Arguments
set: Initialize Command-Line Arguments
Special Parameters
$k and $@: Value of Command-Line
Arguments
$$: PID Number
$?: Exit Status
Command-Line Expansion
Parameter Expansion
Braces
Variable Expansion
Command Substitution
Word Splitting
Pathname Expansion
Summary
Review Exercises
Advanced Review Exercises
Chapter 11
Bourne Shell Programming
Control Structures
if...then
if...then...else
if...then...elif
Debugging Shell Scripts
for...in
for
while
until
break and continue
case
The Here Document
Expanding Null or Unset Variables
:Use a Default Value
:=Assign a Default Value
:?Display an Error Message
Builtins
exec: Execute a Command
trap: Catch a Signal
A Partial List of Builtins
Functions
Summary
Review Exercises
Advanced Review Exercises
Chapter 12
The C Shell
Shell Scripts
Entering and Leaving the C Shell
Startup Files
History
Reexecuting Events
!!: Reexecute the Previous Event
!n: Event Number
!string: Event Text
!n:wWord within an Event
!!:s/new/oldModify a Previous Event
^old^newQuick Substitution
Alias
Quotation Marks: Single versus Double
History Substitution in an Alias
Examples
Command-Line Expansion
{}: Brace Expansion
~: Tilde Expansion
$n: Parameter Expansion
$NAME: Variable Expansion
`cmd` Command Substitution
Job Control
Directory Stack Manipulation
dirs: Display the Contents of the Stack
pushd: Push a Directory onto the Stack
popd: Remove a Directory from the Stack
k ? []: Filename Substitution
Redirecting Standard Error
Filename Completion
Variables
Variable Substitution
String Variables
Arrays of String Variables
Numeric Variables
Expressions
Arrays of Numeric Variables
Braces
Special Variable Forms
Reading User Input
Shell Variables
Shell Variables That Take on Values
Shell Variables That Act as Switches
Control Structures
if
goto
Interrupt Handling
if...then...else
foreach
while
break and continue
switch
Builtins
Summary
Review Exercises
Advanced Review Exercises
Chapter 13
The Korn Shell and Advanced Shell Programming
Korn Shell Basics
Running Scripts
Startup Files
Commands That Are Symbols
Variables
Variable Attributes
Locality of Variables
Keyword Variables
Expanding Shell Variables
String Pattern Matching
Filename Generation
Array Variables
Arithmetic
Assignments
Expressions
Operators
Builtins
Control Structures
select
repeat
Option Processing
getopts: Parse Options
Input and Output
read: Accept User Input
print: Display Output
File Descriptors
Functions
Built-in Commands
Job Control
alias: Shortcut for a Command
kill: Abort a Process
whence: Display the Absolute Pathname of a
Utility
trap: Catch a Signal
Command-Line Editing
Using the vi Command-Line Editor
Pathname Operations
Pathname Listing
Pathname Completion
Pathname Expansion
Using the emacs Command-Line Editor
History
Using the vi Command-Line Editor on Previous
Commands
fc: Display, Edit, and Reexecute Commands
Viewing the History List
Editing and Reexecuting Previous Commands
Reexecuting Previous Commands without Calling the Editor
Command Processing
Token Splitting
Alias Substitution
Filename Expansion
Command Substitution
Parameter Expansion
Arithmetic Expansion
Filename Generation
Processing Quotation Marks
I/O Redirection and the Coprocess
Shell Programs
Program Structures
Recursion
A Programming Problem: makesccs
Another Programming Problem: quiz
Korn Shell Options (set)
Summary
Review Exercises
Advanced Review Exercises
Chapter 14
Programming Tools
Programming in C
Checking Your Compiler
A C Programming Example
Compiling and Linking a C Program
Using Shared Libraries
Fixing Broken Binaries
Creating Shared Libraries
Using LD_PRELOAD
make: Keep a Set of Programs Current
Implied Dependencies
Macros
Debugging C Programs
lint: Find Errors in a Program
gcc: Compiler Warning Options Find Errors in a Program
Symbolic Debuggers
Starting a Symbolic Debugger
The dbx Debugger
The gdb Debugger
Graphical Symbolic Debuggers
Threads
System Calls
truss: Trace System Calls
Controlling Processes
Accessing the Filesystem
Source Code Management
Evolution of an SCCS File
Creating an SCCS File
Retrieving an SCCS File
Recording Changes to an SCCS File
Obtaining the History of an SCCS File
Restricting Access to SCCS Files
Summary
Review Exercises
Advanced Review Exercises
Chapter 15
System Administration
Product Name
The System Administrator and Superuser
System Administration Tools
Avoiding a Trojan Horse
Changing the Default PATH
kill: Terminate a Process
Detailed Description of System Operation
SPARC PROM Mode
Booting the Machine
Solaris x86 Configuration Assistant
Stage I
Device Configuration Assistant
Stage II
Booting the System
Single-User Mode
Maintenance
Checking Filesystem Integrity
Going to Multiuser Mode
Multiuser Mode
Logging In
Running a Program and Logging Out
Bringing the System Down
Going to Single-User Mode
Turning the Power Off
Crashes
Important Files and Directories
Types of Files
Ordinary Files, Directories, Links, and Inodes
Symbolic Links
Special Files
Fifo Special Files (Named Pipes)
Sockets
Major and Minor Device Numbers
Block and Character Devices
Raw Devices
Volume Management
CDROM
Floppy Disk
Day-to-Day System Administration
Adding and Removing Users
Add a New User
Remove a User
Add a Group
admintool
Adding and Removing Software Packages
Web Start
Patches
Backing Up Files
ufsdump, ufsrestore: Backup and Restore
Files
Add/Remove Devices: Reconfigure Reboot
Add/Remove Drivers
Disk Capacity Planning/Partitioning
format: Partitioning a Disk
fdisk: Partitioning a Disk
Add/Remove Printers
Add a Local Printer
Add a Remote Printer for Solaris 2.5 and Earlier
Add a Remote Printer for Solaris 2.6 and Above
Add a Printer Using admintool
Remove a Printer
Check Your Mail and Log Files
Schedule Routine Tasks
Install New Software
Install AnswerBook2
Install AnswerBook2 under Solaris
Share Files with Other Machines
Share Filesystems
Unshare Filesystems
Mount Remote Filesystems
Automatically Mount Filesystems
Unmount Remote Filesystems
Miscellaneous Filesystem Commands
Procfs
Network Services
Set Up Network Files
hosts: List of Machines
netmasks: For a Subnetted Network
defaultrouter: Specify a Default Router
hostname.interface: Specify Network Hardware
NIS
DNS: Domain Name Service
resolv.conf: How to Resolve Hostnames
nsswitch.conf: Specify Order to Consult Services
PPP
sendmail: Set Up Mail
sendmail: Mail Client
sendmail: Mail Server
Aliases
System Reports
sar: Report on System Activity
iostat: Report I/O Statistics
vmstat: Report Virtual Memory Statistics
netstat: Report Network Statistics
mpstat: Report Multiple Processor Statistics
top: Report on Processes Using the Most
Resources
Problems
When a User Cannot Log In
When the System is Slow
lsof: Find Large, Open Files
Keeping a Machine Log
Keeping the System Secure
ACL (Access Control List)
Automated Security Enhancement Tools
Monitoring Disk Usage
Growing Files
Disk Quota System
Removing Unused Space from a Directory
Getting Information to Users
Summary
Review Exercises
Advanced Review Exercises
Part III
The Solaris Utility Programs
sample Very brief description of what the command does
admin Creates or changes the characteristics of an SCCS file
at Executes a shell script at a time you specify
cal Displays a calendar
cat Joins or displays files
catman Preformats and indexes man pages
cc Compiles C programs
cd Changes to another working directory
chgrp Changes the group associated with a file
chmod Changes the access mode of a file
chown Changes the owner of a file
cmp Checks two files to see if they differ
comm Compares sorted files
compress Compresses or decompresses files
cp Copies one or more files
cpio Creates an archive or restores files from an archive
crontab Schedules a command to run regularly at a specified time
cut Selects characters or fields from input lines
date Displays or sets the time and date
dd Copies a file from one device to another
delta Records changes in an SCCS-encoded file
df Displays the amount of available disk space
dfmounts Lists remotely mounted filesystems
diff Displays the differences between two files
dircmp Displays the differences between two directories
du Displays information on disk usage
echo Displays a message
expr Evaluates an expression
file Displays the classification of a file
find Finds files based on various criteria
finger Displays detailed information on users
fmt Formats text very simply
fsck Checks and repairs a filesystem
ftp Transfers files over a network
gcc Compiles gcc, g++, C, and C++ programs
get Creates an unencoded version of an SCCS file
grep Searches for a pattern in files
gzip Compresses or decompresses files
head Displays the beginning of a file
kill Terminates a process
ln Makes a link to a file
lp Prints files
ls Displays information about one or more files
mailx Sends and receives electronic mail
make Keeps a set of programs current
man Displays documentation for commands
mesg Enables/disables reception of messages
mkdir Makes a directory
mkfile Creates a file/swap area
more Displays a file, one screenful at a time
mv Moves (renames) a file
nawk Searches for and processes patterns in a file
nice Changes the priority of a command
nohup Runs a command that keeps running after you log out
od Dumps the contents of a file
paste Joins corresponding lines from files
patch Updates source code
pg Displays a file, one screenful at a time
pr Paginates files for printing
prs Prints a summary of the history of an SCCS file
ps Displays process status
quot Summarizes filesystem ownership information
rcp Copies one or more files to or from a remote computer
rlogin Logs in on a remote computer
rm Removes a file (deletes a link)
rmdel Removes a delta from an SCCS file
rmdir Removes a directory
rsh Executes commands on a remote computer
rwho Displays names of users on computers attached to a network
sed Edits a file (not interactively)
sleep Creates a process that sleeps for a specified interval
sort Sorts and/or merges files
spell Checks a file for spelling errors
stty Displays or sets terminal/emulator parameters
swap Administrates swap space
tail Displays the last part of a file
tar Stores or retrieves files to/from an archive file
tee Copies standard input to standard output and zero or more files
telnet Connects to a remote computer over a network
test Evaluates an expression
touch Updates access and modification time for a file
tr Replaces specified characters
truss Traces a process
tty Displays the pathname of the login device
ufsdump Backs up files or filesystems
ufsrestore Restores files from a ufsdump archive
umask Establishes or displays the file-creation permissions mask
uniq Displays lines of a file that are unique
w Displays information on system users
wc Displays the number of lines, words, and characters in a file
which Shows where a command is located in your path
who Displays names of users
write Sends a message to another user
xargs Converts standard output of one command into arguments for another
Appendix A
Regular Expressions
Characters
Delimiters
Simple Strings
Special Characters
Period
Square Brackets
Asterisk
Caret and Dollar Sign
Quoting Special Characters
Rules
Longest Match Possible
Empty Regular Expressions
Bracketing Expressions
The Replacement String
Ampersand
Quoted Digit
Extended Regular Expressions
Summary
Appendix B
Help!
System Documentation and Information
Where Can I Find More Documentation?
Where Can I Look Up a Word?
What Are Some Useful Solaris Internet Sites?
What Are the Names of Some Solaris Newsgroups?
What Are Some Useful Mailing Lists?
How Do I Find the Program I Want on the Internet?
Utility Programs
Security Programs
Communication Programs
Downloading, Installing, and Running Software
What Is the Difference Between Installing a Binary
and a Source Software File?
How Do I Get a Program Off the Internet and Run It on My
Computer?
How Do I Use ftp?
How Do I Download gzip?
How Do I Install gzip?
Downloading (Using ftp), Compiling, and
Installing GNU make
How Do I Unpack the Software Source Code?
How Do I Compile and Link the Software?
How Do I Install the Compiled Software?
Downloading a File Using a Browser (and
Installing It)
Installing the File
Getting Started with Solaris
How Do I Specify the Terminal I Am Using?
How Do I Send Files to a Printer?
What Is the Name of the Machine I Will Log In On?
What Is My Login Name?
What Is My Password?
What Is the Termcap or Terminfo Name for My Terminal?
Which Shell Will I Be Using?
How Do I Get Started with a Graphical User Interface (GUI)?
What Is a Window?
What Is the Root Window?
What Is a Title Bar?
What Is a Button?
What Is a Slider?
What Is a Scroll Bar?
What Is an Icon?
Appendix C
Security
Encryption
Public Key Encryption
Secret Key Encryption
Implementation
File Security
PGP
Mail Transfer Agents
Mail User Agents
Network Security
Network Security Solutions
Network Security Guidelines
Host Security
Login Security
Remote Access Security
Viruses and Worms
Physical Security
Summary
Appendix D
The POSIX Standards
POSIX.1
The POSIX.1 FIPS
POSIX.2
Localization
The POSIX Shell
Utilities for Portable Shell Applications
cksum
command
getconf
locale
localedef
logger
mkfifo
pathchk
pax
printf
The User Portability Utilities Option (UPE)
Software Development Utilities
POSIX.3
POSIX.4
POSIX.5
POSIX.9
System Administration
Draft POSIX Standards
Security
Networks
Profiles and POSIX Standards
Summary
Glossary
Index
Trademark Acknowledgments