Sie sind auf Seite 1von 67

Operation System Management (Solaris10)

www.huawei.com

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Objectives

Upon completion of this course, you will be able to:

Outline the features of UNIX


Perform basic operation of UNIX Perform the user management Describe the concept of file system List useful commands for file management Perform the basic UNIX system administration

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page2

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page3

UNIX Features

Multi-Tasking

Multi-User
Parallel Processing Pipe Shell High Security

Reliable
Network Oriented File System

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page4

System Architecture of UNIX


Application Program sh

csh cpp

kernel shellB shell


kernel
Hardware

vi

K shellC shell

Application Program
Outer Layer Program

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page5

UNIX Shell Program


Shell Type Main Features Abbreviatio n Command Prompt

Bourne

Original and most popular Provided by every UNIX The base of three Shell Extensions of B Shell K Shell ksh $ B Shell bash $

Shell
Korn

Shell

Compatible with B Shell


Analogous to C language

C-Shell

More capability than B

Shell

The most

C Shell

csh

powerful Shell
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page6

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page7

Login UNIX

Telnet in text window:

telnet 10.77.218.31

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page8

Login UNIX (Cont.)

Telnet in graphic window:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page9

Command Line Structure

Command line structure

command [options] [parameters].


There is a blank between them.

If many parameters are usedthey can be lined up

command -[option1][option2][option3][ ...]

Capital and small letters are different in UNIX commands.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page10

Basic Commands of UNIX

ls: list contents of directory.

cd: change working directory.

pwd: return working directory name.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page11

Basic Commands of UNIX (Cont.)

man: find and display reference manual pages.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page12

Basic Commands of UNIX (Cont.)

Control Keys:

Control-C: Stop running the program


Control-D: Stop the system communication Control-S: To tell the terminal to stop accepting input Control-Q: To tell the terminal to accept input

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page13

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page14

Contents
3. File System Management
3.1 Basic knowledge of File System
3.2 File Management Commands 3.3 View and Edit Commands 3.4 Other Common Commands

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page15

File System
/

/bin

/sbin

/dev

/etc

/usr

/opt

/mnt

/tmp

/home

/etc/passwd

/opt/sybase

directory file

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page16

File Attributes

Link Numbe r Owner

Group

Date and Time

File Size

Name

File Typ e

Group Permissio n Owner Other Permissio Permissio n n


Page17

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

File Attributes (Cont.)

chmod: change the permissions mode of a file.

Absolute Mode:

Symbolic Mode:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page18

File Attributes (Cont.)

chown: change file ownership.

chgrp: change file group ownership.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page19

Contents
3. File System Management
3.1 Basic knowledge of File System
3.2 File Management Commands 3.3 View and Edit Commands 3.4 Other Common Commands

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page20

Create Commands

mkdir: make directories.

touch: change file access and modification times.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page21

Remove Commands

rmdir: remove directory entries.

rm: remove directory entries.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page22

Copy Command

cp: copy files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page23

Move Command

mv: move files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page24

Contents
3. File System Management
3.1 Basic knowledge of File System
3.2 File Management Commands 3.3 View and Edit Commands 3.4 Other Common Commands

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page25

View Commands

cat: concatenate and display files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page26

View Commands (Cont.)

more: browse or page through a text file.

less: opposite of more.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page27

View Commands (Cont.)

head: display first few lines of files.

tail: deliver the last part of a file.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page28

Edit Command

vi:
Function
Switch between Entry Mode and Command Mode
Inserting text Moving around in a file

Command
ESC
aAiIoO hjkl; Ctrl +F Ctrl +B

Deleting text Copying and moving text Save Change & Quit vi

xdd yyYpP :q:wq:q!:wq!

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page29

Contents
3. File System Management
3.1 Basic knowledge of File System
3.2 File Management Commands 3.3 View and Edit Commands 3.4 Other Common Commands

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page30

Count Command

wc: display a count of lines, words and characters in a file.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page31

Compare Command

diff: display line-by-line differences between pairs of text

files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page32

Search Commands

find: find files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page33

Search Commands (Cont.)

grep: search a file for a pattern.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page34

Archive and Compress Commands

tar: create tape archives and add or extract files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page35

Archive and Compress Commands (Cont.)

zip: package and compress (archive) files.

unzip: list, test and extract compressed files in a ZIP archive.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page36

Archive and Compress Commands (Cont.)

gzip: compress or expand files.

gunzip: compress or expand files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page37

Archive and Compress Commands (Cont.)

compress: compress files or display expanded files.

uncompress: uncompress files or display expanded files.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page38

Archive and Compress Commands (Cont.)

Common format and referenced commands:


Create Command Extract Command

Format

.tar
.zip .gz .Z .tar.gz

tar cvf filename.tar dirname


zip filename.zip dirname gzip filename compress filename tar zcvf filename.tar.gz dirname

tar xvf filename.tar


unzip filename.zip gunzip filename.gz uncompress filename.Z tar zxvf filename.tar.gz

.tar.Z

tar Zcvf filename.tar.Z dirname tar Zxvf filename.tar.Z

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page39

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page40

User and Group

User A
User B Group 1

User C
User D Group 2

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page41

User and Group Management

Group Management:

Add a new group:

Delete an existent group:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page42

User and Group Management (Cont.)

User Management:

Add a new user:

Delete an existent user:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page43

User and Group Management (Cont.)

Password management:

Change password for root:

Change password for regular users:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page44

Other Commands

id: return user identity.

who: return who is on the system.

who am i:

whoami:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page45

Other Commands (Cont.)

listusers: list user login information.

su: become super user or another user.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page46

Other Commands (Cont.)

last:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page47

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page48

Hardware Resource Status

sar: system activity reporter

sar t n: samples cumulative activity counters in the operating


system at n intervals of t seconds.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page49

Hardware Resource Status (Cont.)

prtconf: print system configuration

prtconf | grep Memory

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page50

Hardware Resource Status (Cont.)

df: displays number of free disk blocks and files.

df -k:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page51

Hardware Resource Status (Cont.)

du: summarize disk usage

du -k:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page52

Process Management

ps: report process status

ps -ef:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page53

Process Management (Cont.)

kill: terminate or signal processes

kill:

kill -9:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page54

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page55

Configuration & Management

ifconfig: configure network interface parameters

To view the network interface:

ifconfig -a

Configure the IP address and mask:

ifconfig eth0 10.1.1.1 netmask 255.255.255.255

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page56

Configuration & Management (Cont.)

hostname: set or print name of current host system

hostname:

hostname newname:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page57

Configuration & Management (Cont.)

netstat: show network status

netstat -an:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page58

Configuration & Management (Cont.)

ping: send packets to network hosts

ping:

ping -s IP length count:

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page59

File Transfer

ftp: file transfer program


Comman d Function

ascii
bin cd

Sets the "representation type" to "network ASCII".


Sets the "representation type" to "image". Changes the working directory on the remote machine to remotedirectory.

lcd get mget

Changes the working directory on the local machine. Retrieves the remote-file and store it on the local machine. Expands the remote-files on the remote machine and do a get for each file name thus produced.

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page60

Usage of FTP

To get a file from Workstation B (/usr/home), execute the following commands in Workstation A:

% ftp IP address of B User name: XXXX Note: user name Password: XXXX Note: user password ftp>ascii (ascii mode is used to transfer text files while bin mode to

executable files.) Note: transfer mode

ftp>cd /usr/home Note: remote directory ftp>lcd /usr/m2000 Note: local directory ftp>get filename Note: get: download, put: upload ftp>bye Note: exit

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page61

Contents
1. Features of UNIX

2. Basic Operation of UNIX


3. File System Management

4. User Management
5. Resource Management 6. Network Management 7. Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page62

Power off and Restart

shutdownshut down system, change system state

shutdown -y -g( ) -i ( )

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page63

Power off and Restart (Cont.)

initprocess control initialization

init ( ):

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page64

Power off and Restart (Cont.)

Compare of shutdown commands:


When the command is executed

Command

shutdown -i5
init 5 halt poweroff

call rc0 procedure to shut down system


call rc0 procedure to shut down system stop the processor stop the processor

Note: If you use halt or poweroff, the system will go down directly without notice other users, so does reboot. Its recommended to use shutdown or init.
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page65

Summary

Features of UNIX

Basic operation of UNIX


File System Management

User Management
Resource Management Network Management Restart and Shutdown the UNIX

Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved.

Page66

Thank you
www.huawei.com

Das könnte Ihnen auch gefallen