09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

Embed Size (px)

Citation preview

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    1/67

    www.huawei.com

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

    Operation SystemManagement

    (Solaris10)

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    2/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    3/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    4/67

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

    UNIX Features

    Multi-Tasking

    Multi-User

    Parallel Processing

    Pipe Shell

    High Security

    Reliable

    Network Oriented

    File System

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    5/67

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

    System Architecture of UNIX

    kernel

    shell

    B shell

    K shellC shell

    Application Program

    Hardware

    sh csh

    cpp

    vi

    Outer Layer Program

    kernel

    Application Program

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    6/67

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

    UNIX Shell Program

    Shell

    TypeMain Features

    Abbreviatio

    nCommand Prompt

    Bourne

    Shell

    Original and most popular

    Provided by every UNIXThe base of three Shell

    B Shell bash $

    Korn

    Shell

    Extensions of B Shell

    Compatible with B ShellK Shell ksh $

    C-Shell

    Analogous to C language

    More capability than B

    Shell The most

    powerful Shell

    C Shell csh %

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    7/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    8/67

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

    Login UNIX

    Telnet in text window:

    telnet 10.77.218.31

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    9/67

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

    Login UNIX (Cont.)

    Telnet in graphic window:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    10/67

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

    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.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    11/67

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

    Basic Commands of UNIX

    ls: list contents of directory.

    cd: change working directory.

    pwd: return working directory name.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    12/67

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

    Basic Commands of UNIX (Cont.)

    man: find and display reference manual pages.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    13/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    14/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    15/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    16/67

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

    File System

    /

    /bin /sbin /dev /etc /usr /opt /mnt /tmp /home

    /etc/passwddirectory

    file/opt/sybase

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    17/67

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

    File Attributes

    FileType

    OwnerPermission

    GroupPermission

    OtherPermission

    LinkNumber

    Owner

    Group

    FileSize

    Date and Time

    Name

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    18/67

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

    File Attributes (Cont.)

    chmod: change the permissions mode of a file.

    Absolute Mode:

    Symbolic Mode:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    19/67

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

    File Attributes (Cont.)

    chown: change file ownership.

    chgrp: change file group ownership.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    20/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    21/67

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

    Create Commands

    mkdir: make directories.

    touch: change file access and modification times.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    22/67

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

    Remove Commands

    rmdir: remove directory entries.

    rm: remove directory entries.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    23/67

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

    Copy Command

    cp: copy files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    24/67

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

    Move Command

    mv: move files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    25/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    26/67

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

    View Commands

    cat: concatenate and display files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    27/67

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

    View Commands (Cont.)

    more: browse or page through a text file.

    less: opposite of more.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    28/67

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

    View Commands (Cont.)

    head: display first few lines of files.

    tail: deliver the last part of a file.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    29/67

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

    Edit Command

    vi:

    Function Command

    Switch between Entry Mode and Command Mode ESC

    Inserting text aAiIoO

    Moving around in a file hjkl;

    +F +B

    Deleting text xdd

    Copying and moving text yyYpP

    Save Change & Quit vi :q:wq:q!:wq!

    Ctrl Ctrl

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    30/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    31/67

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

    Count Command

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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    32/67

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

    Compare Command

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

    files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    33/67

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

    Search Commands

    find: find files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    34/67

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

    Search Commands (Cont.)

    grep: search a file for a pattern.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    35/67

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

    Archive and Compress Commands

    tar: create tape archives and add or extract files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    36/67

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

    Archive and Compress Commands(Cont.)

    zip: package and compress (archive) files.

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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    37/67

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

    Archive and Compress Commands(Cont.)

    gzip: compress or expand files.

    gunzip: compress or expand files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    38/67

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

    Archive and Compress Commands(Cont.)

    compress: compress files or display expanded files.

    uncompress: uncompress files or display expanded files.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    39/67

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

    Archive and Compress Commands(Cont.)

    Common format and referenced commands:

    Format Create Command Extract Command

    .tar tar cvf filename.tar dirname tar xvf filename.tar

    .zip zip filename.zip dirname unzip filename.zip

    .gz gzip filename gunzip filename.gz

    .Z compress filename uncompress filename.Z

    .tar.gz tar zcvf filename.tar.gz

    dirname

    tar zxvf filename.tar.gz

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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    40/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    41/67

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

    User and Group

    User A

    User B

    User

    C

    UserD

    Group 1 Group 2

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    42/67

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

    User and Group Management

    Group Management:

    Add a new group:

    Delete an existent group:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    43/67

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

    User and Group Management (Cont.)

    User Management:

    Add a new user:

    Delete an existent user:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    44/67

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

    User and Group Management (Cont.)

    Password management:

    Change password for root:

    Change password for regular users:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    45/67

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

    Other Commands

    id: return user identity.

    who: return who is on the system.

    who am i:

    whoami:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    46/67

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

    Other Commands (Cont.)

    listusers: list user login information.

    su: become super user or another user.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    47/67

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

    Other Commands (Cont.)

    last:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    48/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    49/67

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

    Hardware Resource Status

    sar: system activity reporter

    sar t n: samples cumulative activity counters in the operating

    system at n intervals of t seconds.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    50/67

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

    Hardware Resource Status (Cont.)

    prtconf: print system configuration

    prtconf | grep Memory

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    51/67

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

    Hardware Resource Status (Cont.)

    df: displays number of free disk blocks and files.

    df -k:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    52/67

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

    Hardware Resource Status (Cont.)

    du: summarize disk usage

    du -k:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    53/67

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    54/67

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

    Process Management (Cont.)

    kill: terminate or signal processes

    kill:

    kill -9:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    55/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    56/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    57/67

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

    Configuration & Management (Cont.)

    hostname: set or print name of current host system

    hostname:

    hostname newname:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    58/67

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

    Configuration & Management (Cont.)

    netstat: show network status

    netstat -an:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    59/67

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

    Configuration & Management (Cont.)

    ping: send packets to network hosts

    ping:

    ping -s IP length count:

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    60/67

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

    File Transfer

    ftp: file transfer program

    Comman

    d

    Function

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

    bin Sets the "representation type" to "image".

    cd Changes the working directory on the remote machine to remote-

    directory.

    lcd Changes the working directory on the local machine.

    get Retrieves the remote-file and store it on the local machine.

    mget Expands the remote-files on the remote machine and do a get for

    each file name thus produced.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    61/67

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

    Usage of FTP

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

    % ftp IP address of B

    User name: XXXXNote: user name

    Password: XXXXNote: user password

    ftp>ascii (ascii mode is used to transfer text files while bin mode to

    executable files.)Note: transfer mode

    ftp>cd /usr/homeNote: remote directory

    ftp>lcd /usr/m2000Note: local directory ftp>get filenameNote: get: download, put: upload

    ftp>byeNote: exit

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    62/67

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

    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

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    63/67

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

    Power off and Restart

    shutdownshut down system, change system state

    shutdown -y -g( ) -i ( )

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    64/67

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

    Power off and Restart (Cont.)

    initprocess control initialization

    init ( ):

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    65/67

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

    Power off and Restart (Cont.)

    Compare of shutdown commands:

    Command When the command is executed

    shutdown -i5 call rc0 procedure to shut down system

    init 5 call rc0 procedure to shut down system

    halt stop the processor

    poweroff stop the processor

    Note: If you use halt or poweroff, the system will godown directly without notice other users, so does reboot.Its recommended to use shutdown or init.

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    66/67

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

    Summary

    Features of UNIX

    Basic operation of UNIX

    File System Management

    User Management

    Resource Management

    Network Management

    Restart and Shutdown the UNIX

  • 7/29/2019 09-68-OnW209231 Operation System Management (Solaris10) ISSUE1.00

    67/67

    Thank youwww.huawei.com