Tải bản đầy đủ (.pdf) (69 trang)

Sun Fundamentals of Solaris 7 Student Guide With Instructor Notes phần 1 pps

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (381.44 KB, 69 trang )

Fundamentals of Solaris 7

EU-118

Student Guide With Instructor Notes

®

Sun Microsystems, Inc.
500 Eldorado Blvd.
MS: BRM01-209
Broomfield, Colorado 80021
U.S.A.

Revision D, August 1999


Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved.
This product or document is protected by copyright and distributed under licenses restricting its use, copying,
distribution, and decompilation. No part of this product or document may be reproduced in any form by any means
without prior written authorization of Sun and its licensors, if any.
Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.
Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a
registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.
Sun, Sun Microsystems, the Sun Logo, Solaris, AnswerBook, AnswerBook2, SunOS, ONC, OpenWindows, Java, NFS, and
HotJava are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc.
in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun
Microsystems, Inc.
PostScript is a trademark or registered trademark of Adobe Systems, Incorporated, which may be registered in certain
jurisdictions.


The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees.
Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user
interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface,
which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written
license agreements.
U.S. Government approval required when exporting the product.
RESTRICTED RIGHTS: Use, duplication, or disclosure by the U.S. Govt is subject to restrictions of FAR 52.227-14(g)
(2)(6/87) and FAR 52.227-19(6/87), or DFAR 252.227-7015 (b)(6/95) and DFAR 227.7202-3(a).
DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS,
AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Please
Recycle


Contents
About This Course................................................................................... xvii
Course Overview ........................................................................... xviii
Course Map........................................................................................ xix
Module-by-Module Overview ......................................................... xx
Course Objectives.......................................................................... xxvii
Skills Gained by Module............................................................. xxviii
Topics Not Covered........................................................................ xxix
How Prepared Are You?................................................................. xxx
Introductions ................................................................................... xxxi
How to Use Course Materials ...................................................... xxxii
Course Icons and Typographical Conventions ....................... xxxiv
Icons ....................................................................................... xxxiv

Typographical Conventions .................................................xxxv
Notes to the Instructor................................................................. xxxvi
Philosophy ............................................................................ xxxvi
Course Tools ........................................................................ xxxvii
Instructor Setup Notes ..................................................................xxxix
Purpose of This Guide..........................................................xxxix
Course Files.......................................................................................... xl
Course Components ...................................................................xl
Solaris Computing Environment ............................................................1-1
Relevance............................................................................................ 1-2
Introduction to Solaris...................................................................... 1-3
Main Components of a Computer.................................................. 1-5
Random Access Memory (RAM) ............................................1-7
Central Processing Unit (CPU) ...............................................1-7
Input/Output (I/O)..................................................................1-7
Hard Disk (or Other Forms of Mass Storage) .......................1-7
The Solaris Distributed Computing Solution ............................... 1-8
Kernel........................................................................................1-10
Shell...........................................................................................1-12
The File System........................................................................1-14
Main Capabilities of the Operating System ................................ 1-17
iii
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Main Capabilities of the Common Desktop Environment
(CDE) ............................................................................................. 1-18
Exercise: Using the Solaris Computing Environment ............... 1-20
Tasks .........................................................................................1-20
Workshop Labs........................................................................1-21

Exercise Summary...................................................................1-22
Exercise Solutions ...................................................................1-23
Check Your Progress ...................................................................... 1-25
Think Beyond .................................................................................. 1-26
Accessing Your System .............................................................................2-1
Relevance............................................................................................ 2-2
User Accounts.................................................................................... 2-3
The Root Account......................................................................2-3
The /etc/passwd Entry...........................................................2-4
Password Requirements .................................................................. 2-6
The Mouse Buttons ........................................................................... 2-7
The Left Mouse Button.............................................................2-7
The Middle Mouse Button .......................................................2-8
The Right Mouse Button ..........................................................2-8
Logging In .......................................................................................... 2-9
The Options Button.................................................................2-10
Logging in Using the Login Screen ......................................2-12
Logging in Using the Command Line .................................2-13
Exiting From the Command Line .........................................2-14
Changing Your Password.............................................................. 2-15
The CDE Workspaces ..................................................................... 2-17
Managing Windows ....................................................................... 2-18
Overlapping Windows...........................................................2-18
Lowering a Window...............................................................2-19
Moving a Window ..................................................................2-20
Minimizing a Window ...........................................................2-22
Maximizing a Window...........................................................2-24
Closing a Window ..................................................................2-26
Leaving the CDE Session ............................................................... 2-28
Using the Exit Button .............................................................2-28

Exercise: Accessing Your System.................................................. 2-31
Tasks .........................................................................................2-31
Workshop Labs........................................................................2-32
Exercise Summary...................................................................2-33
Exercise Solutions ...................................................................2-34
Check Your Progress ...................................................................... 2-35
Think Beyond .................................................................................. 2-36
Features of the Common Desktop Environment .................................3-1
Relevance............................................................................................ 3-2
The Front Panel Arrangement......................................................... 3-3
iv

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Front Panel Menu Button................................................................. 3-5
Locking the Display.......................................................................... 3-7
Workspace Buttons ........................................................................... 3-9
Minimizing the Front Panel........................................................... 3-12
The Workspace Menu..................................................................... 3-14
Voice and Text Note Applications................................................ 3-16
Address Manager............................................................................ 3-18
Customizing Your Workspace With Style Manager.................. 3-20
Style Manager Options................................................................... 3-22
Color Control ...........................................................................3-22
Font ...........................................................................................3-23
Backdrop ..................................................................................3-24
Keyboard ..................................................................................3-25
Mouse........................................................................................3-26

Beep...........................................................................................3-27
Screen........................................................................................3-28
Window ....................................................................................3-29
Startup ......................................................................................3-30
Notes ................................................................................................. 3-31
Customizing Subpanels ................................................................. 3-32
Application Manager...................................................................... 3-34
Exercise: Using the Front Panel .................................................... 3-36
Tasks .........................................................................................3-36
Workshop Labs........................................................................3-37
Exercise Summary...................................................................3-38
Check Your Progress ...................................................................... 3-39
Think Beyond .................................................................................. 3-40
Getting Help ...............................................................................................4-1
Relevance............................................................................................ 4-2
Front Panel Help ............................................................................... 4-3
Help Viewer....................................................................................... 4-5
Searching the Help Index................................................................. 4-6
AnswerBook2 .................................................................................... 4-7
On Item Help ..................................................................................... 4-9
Other Ways to Access Help ........................................................... 4-11
Displaying Man Pages.................................................................... 4-13
Using the man Command .......................................................4-13
Using the man Command Without Options ........................4-14
Scrolling in Man Pages ...........................................................4-15
Searching Man Pages by Section...........................................4-16
Exercise: Getting Help.................................................................... 4-18
Tasks .........................................................................................4-18
Workshop Labs........................................................................4-19
Exercise Summary...................................................................4-20

Exercise Solutions ...................................................................4-21

v
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Check Your Progress ...................................................................... 4-22
Think Beyond .................................................................................. 4-23
Accessing Files and Directories...............................................................5-1
Relevance............................................................................................ 5-2
File System Structure........................................................................ 5-3
Pathnames .......................................................................................... 5-4
Absolute Pathname...................................................................5-6
Relative Pathname ....................................................................5-8
Command-Line Syntax .................................................................. 5-10
Changing Directories Using the cd Command .......................... 5-12
Command Format...................................................................5-12
Moving Around the Directory Hierarchy ...........................5-13
Displaying the Current Directory Using the pwd Command ... 5-14
Command Format...................................................................5-14
Determining Your Current Directory ..................................5-15
Using the ls Command ................................................................. 5-18
Command Format...................................................................5-18
Listing the Contents of a Directory ......................................5-19
Displaying Hidden Files ........................................................5-19
Displaying File Types.............................................................5-20
Displaying a Long Listing......................................................5-21
Listing Individual Directories ...............................................5-22
Metacharacters................................................................................. 5-23
Asterisk.....................................................................................5-24

Question Mark.........................................................................5-26
Square Brackets .......................................................................5-28
Semicolon .................................................................................5-30
File System Structure...................................................................... 5-32
Exercise: Accessing Files and Directories .................................... 5-33
Tasks .........................................................................................5-33
Workshop Labs........................................................................5-36
Exercise Summary...................................................................5-37
Exercise Solutions ...................................................................5-38
Check Your Progress ...................................................................... 5-42
Think Beyond .................................................................................. 5-43
Directory and File Commands.................................................................6-1
Relevance............................................................................................ 6-2
Control Characters ............................................................................ 6-3
Determining File Type ..................................................................... 6-5
Command Format.....................................................................6-6
Example Text File......................................................................6-6
Example Data File .....................................................................6-7
Example Executable File ..........................................................6-7

vi

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Displaying Files................................................................................. 6-8
Using the cat Command.......................................................6-8
Using the more Command.....................................................6-10
Using the head Command.....................................................6-12

Using the tail Command.....................................................6-14
Using the wc Command .........................................................6-16
Comparing Files .............................................................................. 6-18
Locating Text Differences With the cmp Command ..........6-18
Using the diff Command.....................................................6-20
File and Directory Naming Conventions .................................... 6-23
Creating Files ................................................................................... 6-25
Command Format...................................................................6-25
Creating Empty Files ..............................................................6-25
Creating and Appending Using the tee Command.................. 6-26
Creating Directories........................................................................ 6-28
Command Format...................................................................6-28
Creating Directories................................................................6-29
Copying Files ................................................................................... 6-31
Command Format...................................................................6-31
Copying a File to Another Within a Directory ...................6-32
Copying Multiple Files...........................................................6-32
Preventing Overwriting an Existing File When
Copying .................................................................................6-32
Copying Directories........................................................................ 6-33
Command Format...................................................................6-33
Copying the Contents of a Directory to a New
Directory................................................................................6-34
Moving and Renaming Files ......................................................... 6-35
Command Format...................................................................6-35
Renaming Files in the Current Directory ............................6-36
Moving Files to Another Directory ......................................6-36
Renaming Directories .............................................................6-37
Moving a Directory and Its Contents...................................6-37
Renaming in a Non-Current Directory................................6-38

Removing Files ................................................................................ 6-39
Command Format...................................................................6-39
Removing Directories..................................................................... 6-41
Command Format...................................................................6-41
Removing Directories.............................................................6-42
Redirection ...................................................................................... 6-43
Overview ..................................................................................6-43
Angle Brackets ( >, <, 2> )..................................................6-45
Angle Brackets ( >> )...............................................................6-46
Piping................................................................................................ 6-47
Displaying Command Output One Screen at a Time........6-48
Using the tee Command in a Pipeline ................................6-48
vii
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Exercise: Using Directory and File Commands.......................... 6-49
Tasks .........................................................................................6-49
Workshop Labs........................................................................6-51
Exercise Summary...................................................................6-52
Exercise Solutions ...................................................................6-53
Check Your Progress ...................................................................... 6-56
Think Beyond .................................................................................. 6-57
Managing Files With File Manager ........................................................7-1
Relevance............................................................................................ 7-2
The File Manager............................................................................... 7-3
File and Folder Icons ........................................................................ 7-5
Moving and Copying Files Using Drag-and-Drop ...................... 7-7
Select + Drag + Drop ................................................................7-8
Control + Select + Drag + Drop ..............................................7-8

File Menu Options ............................................................................ 7-9
Creating a New Folder ................................................................... 7-10
Creating a New File ........................................................................ 7-12
Folder or File Name Conflicts ....................................................... 7-13
Changing Folders............................................................................ 7-14
Finding Folders and Files .............................................................. 7-15
Selected Menu Options .................................................................. 7-17
View Menu Options........................................................................ 7-21
Tree Display for Folders.........................................................7-23
Exercise: Managing Files With File Manager.............................. 7-25
Tasks .........................................................................................7-25
Exercise Summary...................................................................7-26
Check Your Progress ...................................................................... 7-27
Think Beyond .................................................................................. 7-28
File Security.................................................................................................8-1
Relevance............................................................................................ 8-2
Security Overview ............................................................................ 8-3
Permissions ........................................................................................ 8-4
Superuser ...................................................................................8-4
The ls -l Command..............................................................8-5
Permission Categories ..............................................................8-7
How File and Directory Access Is Determined ....................8-9
Process For Determining Permissions .................................8-10
Default Permissions ................................................................8-11
Types of Permissions ..............................................................8-12
Changing Permissions.................................................................... 8-15
Overview ..................................................................................8-15
Symbolic Mode........................................................................8-16
Octal (Absolute) Mode ...........................................................8-18


viii

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Default Permissions ........................................................................ 8-22
The umask Filter ......................................................................8-22
Changing the umask Value ....................................................8-26
Exercise: Changing File Permissions............................................ 8-27
Tasks .........................................................................................8-27
Workshop Labs........................................................................8-29
Exercise Summary...................................................................8-30
Exercise Solutions ...................................................................8-31
Check Your Progress ...................................................................... 8-34
Think Beyond .................................................................................. 8-35
Using the vi Editor ....................................................................................9-1
Relevance............................................................................................ 9-2
Introduction to vi ............................................................................. 9-3
vi Modes ............................................................................................ 9-4
Invoking vi........................................................................................ 9-6
Command Format.....................................................................9-6
Input Commands .............................................................................. 9-7
Positioning Commands.................................................................... 9-8
Editing Commands........................................................................... 9-9
Deleting Text..............................................................................9-9
Undoing, Repeating, and Changing Text Commands ......9-10
Copying and Pasting Text .....................................................9-11
Saving and Quitting Files ......................................................9-12
Advanced Editing Options ............................................................ 9-13

Creating and Saving a File............................................................. 9-15
Exercise: Using the vi Editor ......................................................... 9-16
Tasks .........................................................................................9-16
Exercise Summary...................................................................9-17
Check Your Progress ...................................................................... 9-18
Think Beyond .................................................................................. 9-19
Bourne and Korn Shell Variables.........................................................10-1
Relevance.......................................................................................... 10-2
Introduction ..................................................................................... 10-3
Shell Variables ................................................................................. 10-4
Overview ..................................................................................10-4
Local Shell Variables...............................................................10-6
Displaying Shell Variables.....................................................10-8
Environment Variables................................................................... 10-9
Exporting Variables ..............................................................10-10
Displaying Environment Variables ....................................10-12
The PATH Variable .................................................................10-13
The which Command ...........................................................10-14
The whereis Command.......................................................10-14
Exercise: Using Bourne and Korn Shell Variables ................... 10-16
Tasks .......................................................................................10-16
ix
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Workshop Labs.............................................................................. 10-17
Exercise Summary.................................................................10-18
Exercise Solutions .................................................................10-19
Check Your Progress .................................................................... 10-21
Think Beyond ................................................................................ 10-22

Initialization Files....................................................................................11-1
Relevance.......................................................................................... 11-2
Features of Initialization Files ....................................................... 11-3
Overview ..................................................................................11-3
The /etc/profile Script.....................................................11-5
Login Sequence........................................................................11-6
The .dtprofile....................................................................11-10
Shells .......................................................................................11-11
The ENV Environment Variable ................................................... 11-14
Command Format.................................................................11-14
Setting the .kshrc Variable ................................................11-14
Exercise: Setting Initialization Files............................................ 11-16
Tasks .......................................................................................11-16
Exercise Summary.................................................................11-17
Exercise Solutions .................................................................11-18
Check Your Progress .................................................................... 11-19
Think Beyond ................................................................................ 11-20
Basic Features of the Korn Shell ...........................................................12-1
Relevance.......................................................................................... 12-2
Korn Shell Overview ...................................................................... 12-3
Quoting in Shells.....................................................................12-4
Korn Shell Features......................................................................... 12-5
Custom Prompts .....................................................................12-5
Aliases.......................................................................................12-7
History in the Korn Shell ............................................................. 12-10
Overview ................................................................................12-10
The history Command.......................................................12-12
Re-Executing Commands ....................................................12-14
Editing the Command Line .................................................12-16
Additional Features of the Korn Shell ....................................... 12-18

Exercise: Using the Basic Features of the Korn Shell ............... 12-19
Tasks .......................................................................................12-19
Workshop Labs......................................................................12-20
Exercise Summary.................................................................12-21
Exercise Solutions .................................................................12-22
Check Your Progress .................................................................... 12-24
Think Beyond ................................................................................ 12-25
Printing ......................................................................................................13-1
Relevance.......................................................................................... 13-2

x

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Command Line Printing ................................................................ 13-3
Command Format...................................................................13-3
Sending Files to a Printer .......................................................13-4
Displaying Printer Status and Queues......................................... 13-5
Command Format...................................................................13-5
Displaying the Status of All of Your Output Requests......13-6
Displaying Requests on a Specific Printer’s Queue ...........13-6
Determining the Status of All Configured Printers ...........13-6
Determining Which Printers Are Configured on
Your System..........................................................................13-7
Displaying Which Printers Are Accepting Requests .........13-7
Removing a Print Request ............................................................. 13-8
Command Format...................................................................13-8
Canceling a Print Request......................................................13-8

Printer Jobs..................................................................................... 13-10
Viewing Printer Properties .......................................................... 13-12
Setting Printer Job Options .......................................................... 13-14
Printing From the File Manager.................................................. 13-16
Displaying the Banner Page Title ............................................... 13-18
Canceling a Print Request............................................................ 13-19
Exercise: Printing Files ................................................................. 13-21
Tasks .......................................................................................13-21
Exercise Summary.................................................................13-22
Exercise Solutions .................................................................13-23
Check Your Progress .................................................................... 13-24
Think Beyond ................................................................................ 13-25
File and User Information Utilities ......................................................14-1
Relevance.......................................................................................... 14-2
File Systems...................................................................................... 14-3
Inode Numbers................................................................................ 14-5
Linking Files and Directories ........................................................ 14-6
Links..........................................................................................14-6
The ln Command..................................................................14-11
Finding Files .................................................................................. 14-12
The find Command .............................................................14-12
Using the find Command...................................................14-15
Additional Features of the find Command .....................14-16
The grep Command ..................................................................... 14-17
Command Format.................................................................14-18
Switching to Another User Account Using the su
Command.................................................................................... 14-19
Command Format.................................................................14-19
Using the su Command to Become Another User ...........14-20


xi
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Using the id Command .............................................................. 14-21
Command Format.................................................................14-21
Displaying Your Current UID.............................................14-22
Using the who Command............................................................ 14-23
Command Format.................................................................14-23
Displaying Users on the System .........................................14-23
Using the who am i and whoami Commands .......................... 14-25
who am i................................................................................14-25
whoami ....................................................................................14-26
The sort Command ..................................................................... 14-27
Command Format.................................................................14-28
Using sort With Different Options ...................................14-29
Using sort on Different Fields Within a File ...................14-30
Exercise: Using File and User Information Utilities................. 14-31
Tasks .......................................................................................14-31
Workshop Labs......................................................................14-33
Exercise Summary.................................................................14-34
Exercise Solutions .................................................................14-35
Check Your Progress .................................................................... 14-38
Think Beyond ................................................................................ 14-39
Backing Up and Restoring .....................................................................15-1
Relevance.......................................................................................... 15-2
Contents Overview ......................................................................... 15-3
The tar Command ......................................................................... 15-4
Command Format...................................................................15-4
Saving a Directory to Tape ....................................................15-5

The compress Command .............................................................. 15-6
Command Format...................................................................15-6
Command Format: Uncompressing.....................................15-7
The jar Command ......................................................................... 15-8
Command Format...................................................................15-8
Adding All the Files in a Directory to an Archive .............15-9
The mt Command.......................................................................... 15-10
Command Format.................................................................15-10
Commands .............................................................................15-11
Backing up and Restoring the Home Directory ....................... 15-12
Backing up the Home Directory .........................................15-12
Restoring the Home Directory ............................................15-13
Exercise: Saving and Restoring Files.......................................... 15-14
Tasks .......................................................................................15-14
Workshop Labs......................................................................15-14
Exercise Summary.................................................................15-15
Exercise Solutions .................................................................15-16
Check Your Progress .................................................................... 15-17
Think Beyond ................................................................................ 15-18

xii

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


System Processes and Memory Management ....................................16-1
Relevance.......................................................................................... 16-2
System Process Overview.............................................................. 16-3
Process Hierarchy ........................................................................... 16-4

Processes and PIDs ......................................................................... 16-6
Command Format...................................................................16-6
Displaying a Full Listing of All Processes ...........................16-7
Searching for a Specific Process ............................................16-8
Managing Jobs ................................................................................. 16-9
Terminating Processes.................................................................. 16-13
Signals.....................................................................................16-13
The kill Command .............................................................16-14
Command Format.................................................................16-14
Terminating a Process ..........................................................16-14
Memory .......................................................................................... 16-17
Physical Memory (RAM) and Swap Space .......................16-17
Paging .....................................................................................16-19
Exercise: Manipulating System Processes ................................. 16-20
Tasks .......................................................................................16-20
Workshop Labs......................................................................16-21
Exercise Summary.................................................................16-22
Exercise Solutions .................................................................16-23
Check Your Progress .................................................................... 16-25
Think Beyond ................................................................................ 16-26
Network Basics .........................................................................................17-1
Relevance.......................................................................................... 17-2
Client-Server .................................................................................... 17-3
Example Networking Environment .....................................17-3
Distributed Processing ...........................................................17-4
Network....................................................................................17-4
Host ...........................................................................................17-5
Server ........................................................................................17-5
Client.........................................................................................17-5
Naming Services......................................................................17-5

Network Commands ...................................................................... 17-6
telnet ......................................................................................17-6
Using the rlogin Command ........................................................ 17-8
Overview ..................................................................................17-8
Specifying a Different Login ID ..........................................17-10
Logging in Remotely as Another User...............................17-11
Terminating a Local Process From a Remote
Machine ...............................................................................17-12
Using rlogin and pkill to Recover From a
“Hung” CDE Session.........................................................17-13
Using the ftp Command .....................................................17-14

xiii
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Using the rusers Command ...................................................... 17-16
Command Format.................................................................17-16
Displaying Remote Users on a Network ...........................17-16
The NIS+ Naming Service ........................................................... 17-18
Decentralized Administration.............................................17-18
Centralized Administration.................................................17-19
The NFS System ............................................................................ 17-20
NFS Server..............................................................................17-21
NFS Client ..............................................................................17-22
Exercise: Performing Network Basics ........................................ 17-23
Tasks .......................................................................................17-23
Workshop Lab .......................................................................17-23
Exercise Summary.................................................................17-24
Exercise Solutions .................................................................17-25

Check Your Progress .................................................................... 17-26
Think Beyond ................................................................................ 17-27
Mail Tool and Calendar Manager.........................................................18-1
Relevance.......................................................................................... 18-2
The Mail Icon and Mail Window.................................................. 18-3
The Mail Window ........................................................................... 18-4
New Messages .........................................................................18-5
Attached Files ..........................................................................18-5
Increasing and Decreasing the Message Viewing Area ............ 18-6
Responding to a Received Message ............................................. 18-7
Deleting Mail Messages ............................................................... 18-10
Creating Alternate Mailboxes ..................................................... 18-14
Moving Messages to Alternate Mailboxes ................................ 18-15
Composing New Mail Messages ................................................ 18-16
Attaching Files to Mail Messages ............................................... 18-17
Setting up Mail Aliases ................................................................ 18-18
Other Mail Tool Options .............................................................. 18-19
The Calendar Manager................................................................. 18-20
Viewing the Calendar................................................................... 18-22
Day View................................................................................18-22
Week View .............................................................................18-23
Year View ...............................................................................18-24
Adding an Appointment ............................................................. 18-25
Setting Start and End Times ........................................................ 18-26
Selecting a Date ............................................................................. 18-27
Appointment Editor Options ..................................................... 18-28
Printing Calendar Appointments ............................................... 18-30
Setting Calendar Options............................................................. 18-32
Editor Defaults ......................................................................18-33
Display Settings.....................................................................18-34

Access List and Permissions................................................18-35

xiv

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Printer Settings ......................................................................18-36
Date Format ...........................................................................18-37
Finding Appointments ................................................................. 18-38
Browsing Other Calendars .......................................................... 18-39
Exercise: Using the Mail Tool and Calendar Manager ............ 18-40
Tasks .......................................................................................18-40
Exercise Summary.................................................................18-42
Check Your Progress .................................................................... 18-43
Think Beyond ................................................................................ 18-44
Features of the C Shell .............................................................................A-1
C Shell Variables .............................................................................. A-2
Local Variables .........................................................................A-2
Environment Variables............................................................A-3
Path ............................................................................................A-4
History in the C Shell ...................................................................... A-5
The history Command..........................................................A-5
Command-Line Substitution..................................................A-7
C Shell Features .............................................................................. A-12
Customizing Your Prompt ...................................................A-12
Aliases......................................................................................A-13
Command-Line Mail ................................................................................ B-1
Introduction to mailx...................................................................... B-2

Command-Line Mail ....................................................................... B-3
Command Format.................................................................... B-3
Reading Your Mail................................................................... B-3
Sending a Mail Message.................................................................. B-4
Canceling a Mail Message .............................................................. B-5
Reading a Mail Message ................................................................. B-6
Mail Headers............................................................................. B-7
Reading a Specific Message.................................................... B-9
Deleting and Undeleting a Mail Message .................................. B-10
Replying to a Mail Message.......................................................... B-11
Saving a Mail Message .................................................................. B-13
Printing a Mail Message................................................................ B-14
Command Format.................................................................. B-14
Sending a Message to the Printer ........................................ B-14
Quitting Mail .................................................................................. B-15
Sending a File Using Mail............................................................. B-16
Creating a Mail Alias..................................................................... B-17
Command Format.................................................................. B-17
Using Tilde Commands ................................................................ B-18
Command Format.................................................................. B-18
Workshop Lab Solutions .........................................................................C-1
Module 2 – Accessing Your System .............................................. C-3

xv
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module 3 – Introduction to the Common Desktop
Environment .................................................................................. C-4
Module 4 – Getting Help ................................................................ C-5

Module 5 – Accessing Files and Directories................................. C-6
Module 6 – Directory and File Commands .................................. C-7
Module 8 – File Security.................................................................. C-8
Module 10 – Bourne and Korn Shell Variables............................ C-9
Module 12 – Basic Features of the Korn Shell............................ C-10
Module 14 – File and User Information Utilities....................... C-11
Module 15 – Backing Up and Restoring ..................................... C-12
Module 16 – System Processes and Memory Management..... C-13
Module 17 – Network Basics ........................................................ C-14
Metacharacters ...........................................................................................D-1
Introduction to sed and awk.................................................................... E-1
Regular Expressions ........................................................................ E-2
Using Noninteractive Power Tools: sed....................................... E-3
Command Format.................................................................... E-3
Removing Characters With sed ............................................. E-5
Placing Characters at the End of Each Line ......................... E-5
Changing White Space to Colons in Data ............................ E-6
Using Noninteractive Power Tools: awk....................................... E-7
Command Format.................................................................... E-7
Using awk to Display Specific Data ....................................... E-8
The Text Editor .......................................................................................... F-1
Opening a Text Editor Window..................................................... F-2
File Menu Options ........................................................................... F-4
Edit Menu Options .......................................................................... F-7
Replacing Text .................................................................................. F-9
Format Menu Options ................................................................... F-12
Text Editor Options ....................................................................... F-13
Index .....................................................................................................Index-1

xvi


Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


About This Course
Course Goal
This class is designed to introduce new users to UNIX® and the
Common Desktop Environment used with the Solaris™ 7 operating
system. Upon completion of this class, you will have an understanding
of basic UNIX commands and feel comfortable using the many
components of the windowing environment.
The concepts introduced in this class will prepare you for follow-on
courses pertinent to your job duties or career goals. These classes
include SA-237: Solaris 7 System Administration I, SL-120: Shell
Programming, and SL-125: Korn Shell Programming.



Use this module to get the students excited about this course.



With regard to the overheads: To avoid confusion among the students, it is very important
to tell them that the page numbers on the overheads have no relation to the page numbers
in their course materials. They should use the title of each overhead as a reference.



The strategy provided by the “About This Course” is to introduce students to the course

before they introduce themselves to you and one another. By familiarizing them with the
content of the course first, their introductions will have more meaning in relation to the
course prerequisites and objectives.



Use this introduction to the course to determine how well students are equipped with the
prerequisite knowledge and skills.

xvii
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Course Overview
Attending this course provides hands-on experience with useful UNIX
commands. You will also learn to use and customize the features of the
Common Desktop Environment (CDE).
During the course of this class you will learn how to log in and out of
your workstation; gain an understanding of the file structure used in
Solaris 7 and ways in which to navigate this structure; protect your
files from unauthorized use; and create or remove directories and files.
A tutorial designed to introduce the basics of the standard UNIX
editor, vi, is included. Hands-on modules which will familiarize you
with the CDE graphical user interface (GUI) are an integral part of the
instruction. Throughout the course, emphasis is placed on preparing a
foundation of knowledge from which to build.

xviii

Fundamentals of Solaris 7

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Course Map
A complete map of this course is shown below.

Getting Started
Solaris

Accessing Your
System

Computing Environment

Features of the Common
Desktop Environment

Getting Help

Files and Directories
Accessing Files
and Directories

Directory and
File Commands

Managing Files With
File Manager

File Security


Using the

Printing

vi Editor

Solaris Shells
Bourne and Korn
Shell Variables

Initialization Files

Basic Features of
the Korn Shell

Managing Files and Processes
File and User
Information Utilities

Backing Up and
Restoring

System Processes and
Memory Management

Networks

Additional Programs


Network Basics

Mail Tool and
Calendar Manager

About This Course

xix

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
This course includes the following modules:
q

Module 1 – “Solaris Computing Environment”
This module will introduce you to some basic computer concepts
and terminology. In particular, it focuses on the components and
capabilities of the UNIX operating system and the enhancements
of the Solaris computing environment (the Sun™ version of the
UNIX system).

q

Module 2 – “Accessing Your System”
The purpose of a user password, the steps to log in and log out of
a computer, and how to change the user password, are described
in this module.


xx

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
q

Module 3 – “Features of the Common Desktop Environment”
Information on the ways in which the features of the CDE
graphical user interface, particularly the Front Panel, can be used
and modified to make your environment function appropriately
for you is provided in this module.

q

Module 4 – “Getting Help”
This module describes how to access the information resources
available to you, including help for individual items and manual
pages.

q

Module 5 – “Accessing Files and Directories”
This module will introduce you to the concepts concerning files
and directories, including using pathnames, locating and listing
them, and combining file and directory commands.

q


Module 6 – “Directory and File Commands”
Solaris environment commands used to create and remove, find
information about, and perform other tasks on files and directories
are introduced in this module.

q

Module 7 – “Managing Files With File Manager”
How to use the File Manager to organize and manage files is
described in this module.

About This Course

xxi

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
q

Module 8 – “File Security”
This module describes the concepts and skills needed to use basic
security features.

q

Module 9 – “Using the vi Editor”
How to use the vi editor to create and modify text files is

described in this module.

q

Module 10 – “Bourne and Korn Shell Variables”
Setting and unsetting shell and environment variables, with a
focus on the Bourne and Korn shells, is covered in this module.

q

Module 11 – “Initialization Files”
This module describes the files that the shell executes when you
log in to the system and gives an overview of the initialization files
for the Bourne, Korn, and C shells.

xxii

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
q

Module 12 – “Basic Features of the Korn Shell”
Additional information about the Korn shell and its features is
provided in this module.

q


Module 13 – “Printing”
This module discusses the basic command-line commands that are
used to send a file to a printer, check the status of a printer queue,
and cancel a print request, respectively. The graphical interface of
the CDE Print Manager is also covered in detail in this module.

About This Course

xxiii

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
q

Module 14 – “File and User Information Utilities”
This module introduces creating alternate names for files and
directories (linking), using commands to search for files when their
location is not known, and archiving files. This module also looks
at some commands that allow for more user functionality in a
multi-user environment, and tools that help users to manipulate
files and data.

q

Module 15 – “Backing up and Restoring”
Basic UNIX utilities for backing up and restoring files are covered
in this module.


q

Module 16 – “System Processes and Memory Management”
Some helpful commands for viewing and controlling the processes
running on the system are introduced in this module.

xxiv

Fundamentals of Solaris 7
Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


Module-by-Module Overview
q

Module 17 – “Network Basics”
Networking is an integral part of the Solaris 7 environment. This
module introduces some basic networking concepts and
commands.

q

Module 18 – “Mail Tool and Calendar Manager”
The CDE Mail Tool provides a graphical interface for reading,
sending, and replying to electronic mail messages. This module
introduces ways in which the Mail Tool can be customized to meet
a user’s requirements. Calendar Manager provides a variety of
features, including scheduling and reminding you of
appointments, and viewing others’ calendars.


About This Course

xxv

Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D


×