Course materials may not be reproduced in whole or in part without the prior written permission of IBM.© Copyright IBM Corp.. Course materials may not be reproduced in whole or in part w
Trang 1AIX 6 Basics
(Course code AN10)
Instructor GuideERC 1.0
IBM certified course material
cover
Front cover
Trang 2The reader should recognize that the following terms, which appear in the content of this training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation
The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both:
PS/2® is a trademark or registered trademark of Lenovo in the United States, other
Other company, product, or service names may be trademarks or service marks of others
Trang 3Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Contents
Trademarks xi
Instructor course overview xiii
Course description xv
Agenda xvii
Unit 1 Introduction to AIX 1-1
Unit Objectives 1-2 AIX Operating System 1-4 Working on an AIX System (1 of 2) 1-6 Working on an AIX System (2 of 2) 1-9 Activity: Fill in the Blanks 1-12 The Shell: User Interface to AIX 1-14 Useful AIX Utilities 1-17 AIX Graphical User Interfaces 1-19 Checkpoint 1-22 Unit Summary 1-24
Unit 2 Using the System 2-1
Unit Objectives 2-2 Logging In and Out 2-4 Passwords 2-7 Command Format 2-9 Command Format Examples 2-12
The date and cal Commands 2-14 The clear, echo, and banner Commands 2-16
Activity: Questions and Answers 2-18
The who and finger Commands 2-20
Sending Mail 2-23 Receiving Mail 2-26
The write and wall Commands 2-29
talk with Another User 2-32
mesg 2-34 Keyboard Tips 2-36 Checkpoint 2-38 Exercise: Using The System 2-40 Unit Summary 2-42
Unit 3 AIX 6.1 Documentation 3-1
Unit Objectives 3-2
man Command 3-4
man Example 3-6
Trang 4man -k: Working with a Keyword 3-8Viewing AIX 6.1 Documentation 3-10Accessing the Documents from a Web Browser .3-12AIX 6.1 Documentation 3-14Search AIX 6.1 Documentation .3-17Search Scope 3-19Checkpoint 3-21Exercise: AIX 6.1 Documentation 3-23Unit Summary 3-25
Unit 4 Files and Directories .4-1
Unit Objectives 4-2
A File 4-4File Types 4-6Directory Contents .4-9AIX File Systems .4-12Hierarchical Structure 4-14Path Names .4-18Where Am I? 4-20Listing Directories 4-22Long Listing of Files 4-24Change Current Directory 4-28Activity: Q + A 4-30Creating Directories .4-32Removing Directories 4-34Working with Multiple Directories 4-36Displaying Directory Information 4-38AIX File Names 4-40
touch Command 4-42Checkpoint (1 of 2) 4-44Checkpoint (2 of 2) 4-46Exercise: Files and Directories 4-48Unit Summary 4-50
Unit 5 Using Files .5-1
Unit Objectives 5-2Copying Files .5-4
Trang 5Unit 6 File Permissions 6-1
Unit Objectives 6-2Long Listing of Files 6-4File Protection/Permissions 6-7Changing Permissions (Symbolic Notation) 6-9Changing Permissions (Octal Notation) 6-12Default File Permissions 6-15
umask 6-17Activity: Personal Directories 6-20Function/Permissions Required 6-23Checkpoint (1 of 3) 6-25Checkpoint (2 of 3) 6-27Checkpoint (3 of 3) 6-29Exercise: File Permissions 6-31Unit Summary 6-33
Unit 7 The vi Editor 7-1
Unit Objectives 7-2
Introduction to the vi Editor 7-4 Starting vi 7-7
Adding Text 7-9Exiting the Editor 7-11Cursor Movement 7-13Deleting Text 7-16Search for a Pattern 7-18
Activity: vi Commands 7-20
Changing Text 7-22Cut, Copy, and Paste 7-25
vi - Executing AIX Commands 7-28
vi Options 7-31
Command Line Editing 7-34
vi Editors 7-37Checkpoint 7-39
Exercise: vi Editor 7-41
Unit Summary 7-43
Unit 8 Shell Basics 8-1
Unit Objectives 8-2The Shell 8-4Metacharacters and Wildcards 8-6File Name Substitution (1 of 2) 8-8File Name Substitution (2 of 2) 8-10The Standard Files 8-13File Descriptors 8-15
Trang 6Input Redirection 8-17Output Redirection 8-19
Creating a File with cat .8-21
Activity: Review Shell Basics .8-23Error Redirection 8-25Combined Redirection .8-28Pipes 8-31Filters .8-33Split Outputs 8-35Command Grouping 8-37Line Continuation 8-39Checkpoint (1 of 2) 8-41Checkpoint (2 of 2) 8-43Exercise: Shell Basics .8-45Unit Summary 8-47
Unit 9 Using Shell Variables 9-1
Unit Objectives 9-2Shell Variables 9-4Listing Variable Settings 9-6Setting and Referencing Shell Variables .9-8Shell Variables Example 9-10Command Substitution 9-12Quoting Metacharacters 9-14Command Line Parsing .9-16Checkpoint (1 of 2) 9-18Checkpoint (2 of 2) 9-20Exercise: Using Shell Variables 9-22Unit Summary 9-24
Unit 10 Processes 10-1
Unit Objectives 10-2What Is a Process? 10-4Login Process Environment 10-6Process Environment 10-8Parents and Children .10-11Variables and Processes .10-14
Trang 7Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Unit 11 Controlling Processes 11-1
Unit Objectives 11-2Monitoring Processes 11-4Controlling Processes 11-6Terminating Processes (1 of 2) 11-9Terminating Processes (2 of 2) 11-11Signals 11-14Running Long Processes 11-17Job Control in the Korn Shell 11-20Job Control Example 11-23Daemons 11-25Checkpoint 11-27Exercise: Controlling Processes 11-29Unit Summary 11-31
Unit 12 Customizing the User Environment 12-1
Unit Objectives 12-2Login Files 12-4
Sample /etc/environment 12-7 Sample /etc/profile 12-9
Unit 13 AIX Utilities, Part I 13-1
Unit Objectives 13-2
find 13-4Sample Directory Structure 13-7
Using find 13-9 Executing Commands with find 13-11
Interactive Command Execution 13-13Additional Options 13-15
The Shell versus find 13-17
find Examples 13-19AIX Utilities (1) 13-21
Trang 8Other grep Commands 13-36 Activity: grep Command 13-39
sort Command .13-42
sort Examples 13-44
head and tail Commands 13-46
telnet: Login to Remote Hosts .13-49
ftp: Transfers Files Between Hosts 13-51
ftp Subcommands 13-53rexec, rsh: Non-interactive Remote Execution 13-55Secure Shell Utilities (OpenSSH) 13-58
tar: Backup and Restore Files 13-61Checkpoint 13-63Exercise: AIX Utilities (2) .13-65Unit Summary 13-67
Unit 14 AIX Utilities, Part II 14-1
alias and find 14-14
which , whereis, and whence .14-16
file .14-19Exercise: AIX Utilities (3) .14-22
diff (Differential File Comparator) 14-24
Comparing Two Files Using diff 14-26 Comparing Two Files Using cmp 14-29 Comparing Directories Using dircmp 14-31
compress , uncompress, and zcat 14-34
Displaying Non-Printable Characters in Files 14-37Non-Printable Characters in Directories 14-39Assigning Unique File Names 14-41Checkpoint 14-43Exercise: AIX Utilities (4) .14-45Unit Summary 14-47
Trang 9Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
for Loop Syntax 15-25
while Loop Syntax 15-27Command Search Order 15-29
Sample profile 15-31
Checkpoint 15-34Exercise: Additional Shell Features 15-36Unit Summary 15-38
Unit 16 The AIX Graphical User Interface 16-1
Unit Objectives 16-2The X Window System 16-4What is AIXwindows? 16-7
An X Window Network Configuration 16-9The Client/Server Environment 16-12
X Clients 16-14The X Server 16-17Starting AIXwindows 16-19Stopping X 16-22
An AIXwindows Display 16-24The aixterm Window 16-26Running a Client on Another System 16-29The xhost Command 16-32The xauth Command 16-35Common Desktop Environment (CDE) 16-38The Components of the CDE Desktop 16-41The Login Manager 16-43
$HOME/.dtprofile 16-45Front Panel 16-48Front Panel - Subpanels 16-51Front Panel - Further Controls 16-54The Style Manager 16-56The File Manager 16-58The Application Manager 16-60The Personal Applications Manager 16-62The Terminal Emulator 16-64The Help System 16-66Checkpoint Questions (1 of 2) 16-68Checkpoint Questions (2 of 2) 16-70Exercise: Using AIXwindows and CDE 16-72Unit Summary 16-74
Trang 10Appendix A Checkpoint solutions A-1 Appendix B Command Summary B-1 Appendix C Customizing AIXwindows C-1 Appendix D CDE User Customization D-1 Glossary X-1
Trang 11Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
The reader should recognize that the following terms, which appear in the content of this training document, are official trademarks of IBM or other companies:
IBM® is a registered trademark of International Business Machines Corporation
The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both:
PS/2® is a trademark or registered trademark of Lenovo in the United States, other
Other company, product, or service names may be trademarks or service marks of others
Trang 13Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Instructor course overview xiii
pref Instructor course overview
This course has been designed from a user's perspective The students are not required to have any prior knowledge of AIX or any other UNIX-based system
The course sessions have been designed in a logical order to enable the novice user to identify the major components of AIX Then, the students are introduced to the operating system by logging in and out
of the system and carrying out a few basic operations The hierarchical tree structure is explained in detail, and all the functions that can be carried out on files and directories The concept of a shell is introduced and the operations that are supported through it The one editor that is
covered is vi, this being the one that is available on most UNIX
platforms The concept of users owning jobs and thus processes is introduced, including the environment in which processes execute Finally, to pull together all the ideas from the previous units, a few useful tools are introduced which help users customize their environments and write very simple shell scripts, which is the main objective of the course
The course objectives and content are listed in this section Ensure that you cover both at the start of the course to set the correct expectations right from the start
Also note that all your students will have different levels of experience with the operating system and also different capacities in learning So,
it is very important to identify the level of your audience at the beginning and only introduce additional information/discussion items where relevant The discussion items provided can usually be used to challenge the more experienced students
The main teaching aid that is provided with the course is the course visuals However, feel free to demonstrate any of the concepts covered on demonstration workstations or in any other way, if you feel that by doing so you will aid the learning process of the students Finally, remember that this course has been designed for users of the operating system System administrative concepts should not be covered because they are outside the scope of this course For students who are interested in administrative tasks, encourage them
to attend the System Administration and the Advanced System Administration courses The System Administration course covers how a system can be set up from a new installation, whereas the emphasis for the advanced course is more on problem determination
Trang 15Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Course description xv
pref Course description
Prerequisites
Students attending this course should be familiar with basic information technology (IT) concepts and the role of an operating system
Objectives
After completing this course, you should be able to:
• Log in to an AIX system and set a user password
• Use AIX online documentation
• Manage AIX files and directories
• Describe the purpose of the shell
• Use the vi editor
• Execute common AIX commands and manage AIX processes
• Customize the working environment
• Use common AIX utilities
• Write simple shell scripts
• Use the AIXWindows environment
• Use the Common Desktop Environment
Trang 16• Customizing the User Environment
• AIX Utilities, Part I
• AIX Utilities, Part II
• Additional Shell Features
• The AIX Graphical User Interface
Curriculum relationship
This course is the first course in the AIX curriculum and is a prerequisite for all the training paths
Trang 17Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
pref Agenda
Day 1
(00:20) Welcome (00:30) Unit 1 - Introduction to AIX (00:45) Unit 2 - Using the System (00:30) Exercise 1 - Using the System (00:45) Unit 3 - AIX Documentation (00:45) Exercise 2 - AIX Documentation (01:15) Unit 4 - Files and Directories (00:30) Exercise 3 - Files and Directories (00:40) Unit 5 - Using Files
(00:45) Exercise 4 - Using Files
Day 2
(01:00) Unit 6 - File Permissions (00:45) Exercise 5 - File Permissions (00:45) Unit 7 - The vi Editor
(00:45) Exercise 6 - The vi Editor (01:00) Unit 8 - Shell Basics (00:45) Exercise 7 - Shell Basics (00:40) Unit 9 - Using Shell Variables (00:45) Exercise 8 - Using Shell Variables
Day 3
(00:50) Unit 10 - Processes (00:45) Unit 11 - Controlling Processes (00:45) Exercise 9 - Controlling Processes (00:30) Unit 12 - Customizing the User Environment (00:30) Exercise 10 - Customizing the User Environment (00:25) Unit 13 - AIX Utilities, Part I
(00:30) Exercise 11 - AIX Utilities (1) (00:30) Unit 13 - AIX Utilities, Part I (Continued) (00:45) Exercise 12 - AIX Utilities (2)
(00:25) Unit 14 - AIX Utilities, Part II (00:30) Exercise 13 - AIX Utilities (3)
Trang 19Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
pref Text highlighting
The following text highlighting conventions are used throughout this book:
principals
Italics Identifies links to Web sites, publication titles, and is used
where the word or phrase is meant to stand out from the surrounding text
examples of text similar to what you might see displayed, examples of portions of program code similar to what you might write as a programmer, and messages from the system
Monospace bold Identifies commands, daemons, menu paths, and what the user
would enter in examples of commands and SMIT menus
<text> The text between the < and > symbols identifies information the
user must supply The text may be normal highlighting, bold or
monospace, or monospace bold depending on the context
Trang 21Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-1
Uempty Unit 1 Introduction to AIX
Estimated time
00:30
What this unit is about
This unit is an introduction to the course AIX 6 Basics
What you should be able to do
After completing this unit, students should be able to:
• Describe the major components of an AIX system
• Describe the major topics in this course
• Explain the value of these topics when working in an AIX environment
How you will check your progress
Accountability:
• Student activity
• Checkpoint questions
Trang 22Figure 1-1 Unit Objectives AN101.0
Notes:
© Copyright IBM Corporation 2010
Unit Objectives
After completing this unit, you should be able to:
Ɣ Describe the major components of an AIX system
Ɣ Describe the major topics in this course
Ɣ Provide the value of these topics when working in an AIX
environment
Trang 23Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-3
Uempty Instructor notes:
Purpose — Explain what students will learn in this unit
Details —
Additional information — None.
Transition statement — Let's start with a high-level view of the AIX operating system
Trang 24Figure 1-2 AIX Operating System AN101.0
Notes:
The AIX Kernel
A computer consists of many hardware devices that the users of a computer system want to use For example, they want to print documents or they want to play a game from a CD-ROM
© Copyright IBM Corporation 2010
AIX Kernel
Interface to hardware
Manages processes
Process 1 Process 2 Process 3 Process 4
User fred
User sarah
AIX Operating System
Trang 25Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-5
Uempty Instructor notes:
Purpose — Describe the role of an operating system and the AIX Kernel
Details — Give an easy introduction Keep things simple and explain as described in the
notes
Additional information —
Transition statement — Let's introduce what students will learn in this course
Trang 26Figure 1-3 Working on an AIX System (1 of 2) AN101.0
Notes:
Log in
takes place The user must log in with the user’s username and password
Trang 27Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-7
Uempty Communication
Multiple users can work at the same time on an AIX system or in a network One of the basic tasks in your daily work is to communicate with other users on a system or in the network In this course, you will learn different commands that allow communication with other users
Additional information
AIX offers a wide range of tools and commands There are multiple ways to obtain
Documentation How to work with these help tools is also a major topic in this course
Trang 29Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-9
Uempty
Notes:
AIX file structure
One of the major tasks of a computer system is to read and write data In order to do
Each of these subdirectories can contain files or other subdirectories A directory is like
a folder in which you put certain documents
File system types
The file tree is mounted during the system startup AIX supports different file system types, which are all mounted to one big file tree This is shown on the visual Parts of this file tree reside on a disk, other parts may reside on a CD-ROM, or are mounted from another computer in a network
© Copyright IBM Corporation 2010
DATA
Working with files
Edit, Print
The vi editor is available
on most UNIX platforms
Working on an AIX System (2 of 2)
Trang 30What you will learn
This course explains how to work with directories and files on a user level You will learn how to navigate in the file tree and how to manage directories You will learn how to
copy, move, delete and print files, and how to edit files using vi, which is the common
UNIX editor Another topic will show how to specify correct file permissions
Trang 31Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-11
Uempty Instructor notes:
Purpose — Explain the terms file systems, file tree, directory, and file and how these
components can be found in the course
Details — Mention the vi editor because there is one question in the checkpoint
Also, point out that the vi editor is very important in this course and there will be an entire unit on vi later in the course.
We will have a closer look at directories (file systems) later in this course
Additional information —
Transition statement — Let's have a short activity to review some terms
Trang 32Figure 1-5 Activity: Fill in the Blanks AN101.0
Notes:
Operating system components
It is very important that you be able to identify the most important components of an operating system
This visual introduces these components, but as you notice, the visual is not complete
© Copyright IBM Corporation 2010
Trang 33Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-13
Uempty Instructor notes:
Purpose — To describe the meaning of the kernel, the shell, and file systems
Details — Give the students some time to think about the missing words
The missing words are:
Trang 34Figure 1-6 The Shell: User Interface to AIX AN101.0
The Shell: User Interface to AIX
Trang 35Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-15
Uempty Customization
The shell is customizable That means the user interface may be tailored according to
the requirements of each user Customizing the user environment is another topic in this course
Besides all these properties, the shell is a programming language You can write shell scripts to create and tailor commands Writing simple shell scripts will be covered later
in this course
Trang 37Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-17
Uempty
Notes:
AIX utilities
components, AIX offers a wide range of utilities:
- The find command to search for specific files
- The grep command to search for patterns in files
- Commands to compare files and directories
- Commands to compress and uncompress files to save disk space Note that this list is not complete Besides these utilities, the course introduces
additional tools that are useful for your work
© Copyright IBM Corporation 2010
file1
Search for specific files Search for patterns in files
Compare files and
Useful AIX Utilities
Trang 38Instructor notes:
Purpose — Explain that this course introduces a wide range of utilities
Details — We will cover the description of important directories of the filesystem later in
this course
Additional information —
Transition statement — Let's introduce the graphical user environments that come with
AIX
Trang 39Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp 2010 Unit 1 Introduction to AIX 1-19
Uempty
Notes:
Graphical user interfaces
Modern operating systems are based on graphical desktops These desktops consist of
windows to manage the screen space, and further controls
system
AIX offers two different graphical user interfaces:
- AIXwindows
- Common Desktop Environment (CDE)
Information on using and customizing these desktops is included in the appendix of this course
© Copyright IBM Corporation 2010
Windows
Icons
Mouse Pointer
Environment (CDE)
AIX Graphical User Interfaces
Trang 40Additional user interfaces
graphical user interfaces:
- KDE
- GNOME