Вы находитесь на странице: 1из 124

V2.0.0.1

cover

V2.0.0.1 cover Front cover Linux Basics and Installation (Course Code Q LX02) Instructor Exercises Guide ERC

Front cover

Linux Basics and Installation

(Course Code QLX02)

Instructor Exercises Guide

ERC 5.0

IBM Certified Course Material

Instructor Exercises Guide

Trademarks

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:

AIX

DB2

Domino

Lotus

OS/2

PS/2® is a trademark or registered trademark of Lenovo in the United States, other countries, or both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

UNIX® is a registered trademark of The Open Group in the United States and other countries.

Linux® is a registered trademark of Linus Torvalds in the United States, other countries, or both.

Other company, product, or service names may be trademarks or service marks of others.

October 2006 Edition

The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

© Copyright International Business Machines Corporation 2001, 2006. All rights reserved. This document may not be reproduced in whole or in part without the prior written permission of IBM. Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.

V2.0

Instructor Exercises Guide

TOC

Contents

Trademarks

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

v

Instructor Exercises Overview

 

vii

Exercises Configuration

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. ix

Exercises Description

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

xi

Exercise 1. Introduction to Linux

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

1-1

Exercise 2. Installing Linux

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2-1

Exercise 3. Using the System

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

3-1

Exercise 4. Working with Files and Directories

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

4-1

Exercise 5. File and Directory Permissions

 

5-1

Exercise 6. Linux Documentation

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

6-1

Exercise 7. A Tour through Linux

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

7-1

Exercise 8. Editing Files

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

8-1

Exercise 9. Shell Basics

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

9-1

Exercise 10. Working with Processes

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

10-1

Exercise 11. Linux Utilities

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

11-1

Exercise 12. Shell Scripting

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

12-1

Exercise 13. The Linux GUI

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

13-1

Exercise 14. Customizing the User Environment

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

14-1

Exercise 15. Basic System Configuration

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

15-1

Exercise 16. Integrating Linux in a Windows Environment

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

16-1

Exercise 17. End-of-course Challenge Exercise

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

17-1

© Copyright IBM Corp. 2001, 2006

 

Contents

 

iii

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

iv Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

TMK

Trademarks

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:

AIX®

DB2®

Domino®

Lotus®

OS/2®

PS/2® is a trademark or registered trademark of Lenovo in the United States, other countries, or both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

UNIX® is a registered trademark of The Open Group in the United States and other countries.

Linux® is a registered trademark of Linus Torvalds in the United States, other countries, or both.

Other company, product, or service names may be trademarks or service marks of others.

© Copyright IBM Corp. 2001, 2006

Trademarks

v

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

vi Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

pref

Instructor Exercises Overview

The objective of these exercises is to let students become familiar with Linux on a workstation, so that they feel comfortable enough to start using Linux on their personal workstation at work and/or at home. For this reason, a limited number of system administration tasks need to be covered. It is not the purpose of this course to teach students how to set up a Linux server. For that, other courses are available from IBM.

Before teaching this course, read the Overview Exercise Description. It is included in this guide as well as in the Student Exercises book. This section explains the format of the different exercise sections. It is important that this is covered with the students as an overall exercise introduction before the first exercise is started.

© Copyright IBM Corp. 2001, 2006

Instructor Exercises Overview

vii

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

viii Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

pref

Exercises Configuration

See the Lab Setup Guide for details of the software and hardware required for this course.

© Copyright IBM Corp. 2001, 2006

Exercises Configuration

ix

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

x Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

pref

Exercises Description

The objective of the Linux Power User exercises is to let the you become familiar with installing and running Linux on your personal workstation. To achiev e this, a variety of r eal-world exercises are performed, aimed at simulating real-world tasks.

Each exercise unit consists of two parts:

Exercise Instructions — This section contains what it is you are to accomplish. There are no definitive details on how to perform the tasks. You are given the opportunity to work through the exercise given what you learned in the unit presentation, utilizing the unit Student Notebook, your past experience, the online documentation and maybe a little intuition.

Exercise Instructions With Hints — This section is an exact duplicate of the Exercise Instructions section except that in addition, specific details and/or hints are provided to help step you through the exercise. A combination of using the Instructions section along with Instructions With Hints section can make for a rewarding combination providing you with no hints when you don't want them and hints when you need them.

In this last section, multiple ways to accomplish the same task are often provided. Where this has been done, the various methods are separated by an -OR-

All exercises and hints apply both to Fedora, RHEL and SLES equally, unless mentioned.

© Copyright IBM Corp. 2001, 2006

Exercises Description

xi

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

xii Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty Exercise 1. Introduction to Linux

Notice: This unit has no exercises. This page is here to ensure that unit numbers and exercise numbers stay synchronized.

© Copyright IBM Corp. 2001, 2006

Exercise 1. Introduction to Linux

1-1

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

1-2

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty Exercise 2. Installing Linux

What This Exercise Is About

This exercise lets you install Linux.

What You Should Be Able to Do

After completing this exercise you should have experience with:

• Preparing a system for installation

• Partitioning a system

• Installing Linux

Required Materials

• A set of installation CDs or a network capable boot CD for your distribution

© Copyright IBM Corp. 2001, 2006

Exercise 2. Installing Linux

2-1

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

Exercise Instructions

Note: The exercises in this course material have been designed for and tested on the following three distributions:

• Fedora Core 5

• Red Hat Enterprise Linux (RHEL) 4 Update 3 Enterprise Server

• SUSE Linux Enterprise Server (SLES) 10

If you are using one of these three distributions, follow the instructions below that apply to your distribution. If you are using another distribution, or another version of one of the three distributions above, then your instructor gives you additional information.

Depending on the circumstances, your instructor loans you a full set of CDs for each distribution, so you can perform a CD-based install, or your instructor loans you an installation CD, so you can perform a network-based install.

If you need to perform a network install, your instructor gives you additional information, specifically:

• The install method: NFS (FTP or HTTP is also available)

• The IP address that is to be used for your workstation, if DHCP is not used

• The name or IP address of the install server

• The path to the installation images on the install server

Installing Fedora Cora 5

1.

Insert the Fedora Core 5 CD 1 in the CD-ROM drive.

2.

Turn on or reboot the computer.

3.

The system boots from CD, and you see a screen giving you different installation options. We use a non-standard installation, so type “linux askmethod” and press Enter.

Note: If your system is not booting from CD, then either your system cannot boot from CD at all, or your BIOS is not set up to boot from CD. In this case, ask your instructor for additional instructions.

4.

Choose the language for the installation process and choose OK.

5.

Choose your keyboard model and layout, and choose OK.

6.

Choose the network installation method: NFS image then choose OK.

Note: Your instructor should give you additional information if you are to use HTTP or FTP.

7.

Configure the local IP configuration as DHCP then choose OK.

8.

Enter the details of the network install server then choose OK:

2-2

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

NFS server name: 10.0.0.1

Fedora Core Directory: /export/fedo5

9.

Fedora now starts the graphical install method. This might take a couple of minutes. At the graphical “Fedora Copyright” screen, click Next.

10. OPTIONAL: Choose your mouse type and port. If you have a two-button mouse, select “Emulate 3 Buttons” (if available). Click Next.

11. OPTIONAL: Choose your monitor and click Next.

12. Fedora now lets you choose to “Remove all partitions

” and “Review and modify

” then click Next.

13. The Disk Druid screen appears and shows the current layout of your disks. You first need to delete all partitions manually. You can now start adding Linux partitions. Make sure you create three additional partitions:

• One partition is used as root partition. Its Mount Point should be “/”, the File System Type should be “ext3”, the size of this partition should be 6 GB (6000 MB).

• Add a boot partition. It’s Mount Point should be /boot, the File System Type should be “ext3” and the size of this partition should be 100 MB.

• The last partition is used as swap space which does not have a Mount Point (it shows as “<Not Applicable>”). The size should be equal to the amount of real memory, with a maximum of 1000 MB, and the File System Type should be “swap”.

14. Let the instructor check your partition configuration before you save it! After the instructor has checked your partition configuration, click Next.

15. The installation program now allows you to configure your boot loader. You can accept all defaults here, then click Next:

• Use GRUB as the boot loader.

• The default boot image is Fedora Core.

• Do not use a boot loader password or configure advanced options.

16. Configure your network adapters. Your instructor should tell you whether to use DHCP or will provide you with the IP Address, Netmask, Network and Broadcast addresses, with the Hostname, Gateway and DNS addresses. Enter these values, double-check them, and click Next.

17. Now select your Time Zone, then click Next.

18. In the next screen you need to set the root password. For convenience in the class, set the root password to ibmlnx then click Next.

19. At the “Software” screen, select “Customize now”. Click Next and add the “KDE Desktop Environment” group and click Next.

© Copyright IBM Corp. 2001, 2006

Exercise 2. Installing Linux

2-3

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

20. Note the location of the log file: /root/install.log and click Next.

21. Fedora now formats the filesystems and installs Fedora Core 5. This may take anywhere from 5 minutes to an hour, depending on the number of packages to install, and the speed of the computer.

While installing, you can see what is going on in detail by switching to the third virtual terminal with Ctrl-Alt-F3. Switch back with Alt-F7. Also, take a look at other virtual screens (1 through 6).

22. Your installation is now complete. Remove the boot disk from the drive and click Reboot to reboot your system.

23. When your Fedora system boots for the first time, the Fedora Setup Agent is started. Click the “Forward” button (even though the screen says to click “Next”!).

24. Read the License Agreement, select “Yes, I agree

25. The next screen allows you to configure firewall rules. Choose Disabled from the Firewall pull-down and click Forward. Disable the SELinux Setting the same way and click Next then click Yes.

26. Check the date and time. If the network has an NTP server, configure it here as well. Click Forward.

27. Configure your display -- change Monitor Resolution and Color Depth if necessary, then click Forward.

28. Add a personal user account for yourself, with a password you make up yourself. Then click Forward.

29. Verify that your sound card has been detected and is configured correctly, by playing a test sound. Then click Yes, then Forward.

30. The installer may ask that you reboot your machine at this time -- do so and the installation is complete.

” and click Forward.

2-4

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

Installing Red Hat Enterprise Linux 4 ES

1.

Insert the RHEL4 ES CD 1 in the CD-ROM drive.

2.

Turn on or reboot the computer.

3.

The system boots from CD, and you see a screen giving you different installation options. We use a non-standard installation, so type “linux askmethod” and press Enter.

Note: If your system is not booting from CD, then either your system cannot boot from CD at all, or your BIOS is not set up to boot from CD. In this case, ask your instructor for additional instructions.

4.

Choose the language for the installation process and choose OK.

5.

Choose your keyboard model and layout, and choose OK.

6.

Choose the network installation method: NFS image then choose OK.

Note: Your instructor will give you additional information if you are to use HTTP or FTP.

7.

Configure the local IP configuration as DHCP then choose OK.

8.

Enter the details of the network install server then choose OK:

NFS server name: 10.0.0.1

RHEL4 Directory: /export/rhel4

9.

RHEL now starts the graphical install method. This might take a couple of minutes. At the graphical “Welcome to Red Hat Enterprise Linux ES” screen, click Next.

10. OPTIONAL: Choose your mouse type and port. If you have a two-button mouse, select “Emulate 3 Buttons” as well. Click Next.

11. OPTIONAL: RHEL now tries to detect an existing installation. If an existing installation has been detected, you see the “Upgrade Examine” screen. In this screen select “Perform a new Red Hat Linux installation”. Click Next.

12. At the “Disk Partitioning Setup” screen, Choose to “Manually partition with Disk Druid”. Click Next.

13. The Disk Druid screen appears and shows the current layout of your disks. You first need to delete all partitions manually. You can now start adding Linux partitions. Make sure you create three additional partitions:

• One partition is used as root partition. Its Mount Point should be “/”, the File System Type should be “ext3”, the size of this partition should be 6 GB (6000 MB).

• Add a boot partition. It’s Mount Point should be /boot, the File System Type should be “ext3”, the size of this partition should be 100 MB.

© Copyright IBM Corp. 2001, 2006

Exercise 2. Installing Linux

2-5

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

• The last partition is used as swap space which does not have a Mount Point (it shows as “<Not Applicable>”). The size should be equal to the amount of real memory, with a maximum of 1000 MB, and the File System Type should be “swap”.

14. Let the instructor check your partition configuration before you save it! After the instructor has checked your partition configuration, click Next.

15. The installation program now allows you to configure your boot loader. You can accept all defaults here, then click Next:

• Use GRUB as the boot loader

• The default boot image is RHEL.

• Do not use a boot loader password or configure advanced options.

16. Configure your network adapters. Your instructor should tell you whether to use DHCP or not will provide you with the IP Address, Netmask, Network and Broadcast addresses, and with the Hostname, Gateway and DNS addresses. Enter these values, double-check them and click Next.

17. The next screen allows you to configure firewall rules. Choose No firewall and change the SELinux setting to Disabled and click Next then click Proceed.

18. The installer now asks for languages to be installed. Select all languages you are planning to use on your system and click Nest.

19. Now select your Time Zone, then click Next.

20. In the next screen you need to set the root password. For convenience in the class, set the root password to ibmlnx then click Next.

21. At the “Package Installation” screen, select “Customize software packages to be installed” then click Next and add the “KDE Desktop Environment” group then click Next.

22. Note the location of the log file: /root/install.log and click Next.

23. RHEL now formats the file systems and install Red Hat Enterprise Linux ES. This takes anywhere from 5 minutes to an hour, depending on the number of packages to install, and the speed of the computer.

While installing, you can see what is going on in detail by switching to the third virtual terminal with Ctrl-Alt-F3. Switch back with Alt-F7. Also, take a look at other virtual screens (1 through 6).

24. Your installation is now complete. Click Reboot to reboot your system and remove your CD.

25. When your Red Hat Enterprise Linux system boots for the first time, the Red Hat Setup Agent is started. Click the “Next” button.

26. Read the License Agreement, select “Yes, I agree

” and click Next.

2-6

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

27. Check the date and time. If the network has an NTP server, configure it here as well. Click Next.

28. Configure Display (for X). Choose Configure then Resolution then Color Depth.

29. OPTIONAL: On Red Hat Login screen, choose “Tell me why I need to register and click Next.

30. OPTIONAL: Click “I cannot complete registration

31. Add a personal user account for yourself, with a password you make up yourself. Then click Next.

32. Verify that your sound card has been detected and is configured correctly, by playing a test sound then click Yes, then Next.

33. Do not install additional software. Click Next, then click Next again. Your system b soon allow you to login.

” and click Next.

© Copyright IBM Corp. 2001, 2006

Exercise 2. Installing Linux

2-7

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

Installing SUSE Linux Enterprise Server 10

1.

Insert the SLES 10 CD in the CD-ROM drive.

 

2.

Turn on or reboot the computer.

3.

The system boots from CD, and you see a screen giving you different installation options.

Note: If your system is not booting from CD, then either your system cannot boot from CD at all, or your BIOS is not set up to boot from CD. In this case, ask your instructor for additional instructions.

If you are going to do a network-based installation, then select F4 and choose NFS. Fill in the NFS information: NFS Server: 10.0.0.1 NFS Directory:

/export/sles10 and then press Enter. If it tries to access server and fails, this is okay. Continue with these next steps -- otherwise skip to Step 4.

a.

Select the language and keyboard map (if asked) for the network configuration process and click Next.

b.

In the main menu, select “Kernel Modules (hardware drivers)”. Then, select “Load network card modules”. Now select the network driver (kernel module) you need for your network card and press Enter. If you don’t know what network card is in the system, ask the instructor. Do not add any parameters, unless your instructor tells you so. You should now get a message “Module xxx loaded successfully”. If this message does not appear, ask your instructor for help.

c.

Go back to the main menu and select “Start installation / system”. Then select “Start installation/update”.

d.

Select “Network” as the source medium. Select the network install protocol (FTP, HTTP, NFS, SMB or TFTP).

e.

Check with your instructor whether the systems in the classroom should be configured using DHCP or static information and make the choice accordingly.

f.

Enter the IP address of the install server, then enter the installation directory where the install image is located.

4.

Select the language and keyboard map (if asked) for the installation process and click Next.

5.

On the License Agreement screen, choose “Yes, I agree

and click Next.

6.

If your system has already been installed with Linux, then you may get a pop-up window about this. Select “New installation” and click Next.

7.

Browse through the autodetected installation settings, and make changes if required:

• Make sure your correct timezone and keyboard map are selected.

2-8

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

• Click Partitioning then choose Create Custom Partition Setup, then Next. Now choose Custom Partitioning and Next. Delete all partitions that you see. Make these choices to create 3 partitions:

- Create, Primary, OK, Format as ‘ext3’, highlight the number in the “End” box and change it to 6 GB, enter “/” in the Mount Point box, then OK.

- Create, Primary, OK, Format as ‘ext3’, highlight the number in the “End” box and change it to 100 MB, enter “/boot” in the Mount Point box, then OK.

- Create, Primary, OK, Format as ‘Swap’, highlight the number in the “End” box and change it to 1GB, then OK, then Finish then No.

• Click Software, make sure that you add “KDE System” to the default selection of software then click Accept.

Click Accept and click “Yes, install” at the pop-up screen. SLES 10 now installs itself. This takes 5 minutes to an hour, depending on the speed of your computer.

8.

Note that SLES 10 automatically reboots when it is nearly finished with the first CD. This is normal. When the initial boot screen appears, do nothing so that the system boots from hard disk. The installation process should continue automatically.

9.

On the Hostname and Domain Name screen, check the box next to “Change Hostname via DHCP” then click Next.

10. Next, you need to enter the root password. For convenience in class, use ibmlnx as the root password and click Next.

11. The Network Configuration screen allows you to configure your network. Make sure all detected values are ok. If necessary, consult your instructor for IP addresses and such. Then, click the word “Enabled” next to “Firewall:” to toggle the firewall setting and click Next.

” your Internet connection

12. Even if you have an Internet connection, click “No, skip test and click Next.

13. On the next screen, choose Skip Configuration and click Next.

14. Select “Local (/etc/passwd)” as User Authentication Method. Click Next.

15. Add a local user account for yourself, using a secret password. Do not select “Auto Login”. Then click Next.

16. SuSEConfig now executes several configuration scripts. This might take several minutes.

17. If you feel like it, read the release notes for this version. Then click Next.

18. Check your hardware configuration, then click Next then Finish.

19. Remove the installed CD from the CD-drive and log in when the system is ready.

© Copyright IBM Corp. 2001, 2006

Exercise 2. Installing Linux

2-9

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

END OF EXERCISE

V2.0

Instructor Exercises Guide

EXempty Exercise 3. Using the System

What This Exercise Is About

The purpose of this exercise is to become familiar with Linux, the command syntax and some basic commands. The exercise also serves to show some multi-user concepts.

What You Should Be Able to Do

At the end of the lab, you should be able to:

• Switch between virtual terminals

• Log in to a Linux system and change passwords

• Execute basic commands

• Use the wall and write commands to communicate with other users

• Use keyboard control keys to control command line output

• Use the mouse to copy and paste commands

• Use the command history

• Lock a Linux system

• Log out of a Linux system

© Copyright IBM Corp. 2001, 2006

Exercise 3. Using the System

3-1

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

Exercise Instructions

Logging in on a virtual terminal

In this section you are going to log in to the system using both text and graphical virtual terminals.

1.

If the install went correctly then you should now see a graphical login prompt. If this is not the case, ask your instructor to fix this. (You learn how to do this yourself later in the course.)

2.

Verify that you indeed have seven different virtual terminals. Cycle through them by pressing Alt-Fn, where n is the terminal number you want to access. Use Ctrl-Alt-Fn when you are in a graphical terminal.

3.

In your first virtual terminal (tty1), log in to the system with your own username which you also configured when installing the system.

4.

In your second virtual terminal (tty2), log in to the system as root. After having logged in, look at the command prompt. Do you notice anything different from the command prompt in the other virtual terminals?

5.

In your seventh virtual terminal (tty7), log in to the system with your own username and password.

6.

Open a terminal window. Take a look at the command prompt. Does it differ from the command prompt on tty1? Why or why not?

Basic Commands

In this section we are going to execute some basic commands, in order to familiarize yourself with the command syntax of Linux, and the fact that you are currently on a multi-user, multi-tasking system.

All commands in this section are executed on virtual terminal seven (the graphical login prompt where you are logged in as yourself), using the terminal window you just opened, unless specified otherwise.

7.

Change your password. Memorize this password because no one can find out your password if you forget it.

8.

Display the system's date.

9.

Display the whole calendar for the year 2007.

10. Display the month of January for the year 1999 and 99. Are 1999 and 99 the same?

11. Generate a list of all users present on your system.

12. Display your login name.

13. Display the login information of your own user account, and of root.

14. Clear your screen.

3-2

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

15. Print the text Out to lunch on your display.

16. Make sure you are willing to receive messages.

17. Write the message Out to lunch to the display of root. Check whether root got the message.

18. Write the message Out to lunch to the display of all users. Check whether everybody on your system got the message.

Keyboard and Mouse Tips

19. The bash shell has a command history function. View some of the commands you have entered. Try to alter one of these commands, then run the command again.

20. Your terminal has a buffer that keeps track of the output of your commands. View the output of the previous commands.

21. Bash supports command and filename completion with the TAB character. Try to use this feature, both on commands and on filenames.

22. Both in a text terminal and an emulated terminal in the graphical desktop, try to re-execute commands by scrolling up a little, selecting the command with the left mouse button, and then pasting it onto the same terminal again with the middle mouse button.

Also try this across different text and graphical terminals.

Note: SuSE does not enable gpm by default, so your mouse won’t work in a text terminal when you are using SuSE.

Using the history

23. Use the history command to view the last 20 commands you typed.

24. Execute one of the commands from the history list.

25. Execute the echo command again, this time changing the word “lunch” to “dinner”.

26. Bash also supports searching in the history. Try this feature as well.

Locking terminals

Note: Not all distributions install vlock and xlock by default. If vlock and xlock are not installed, then you learn how to do that in Exercise 15 - Basic System Configuration.

27. Lock a virtual terminal. Can you switch to another virtual terminal while this one is locked? Unlock the terminal.

28. Lock the console. Can you switch to another virtual terminal now? Unlock the console.

© Copyright IBM Corp. 2001, 2006

Exercise 3. Using the System

3-3

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

29. Lock the graphical environment and then unlock it again.

Logging off 30. Log off all users that are logged in at any TTY.

END OF EXERCISE

3-4

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

Exercise Instructions With Hints

» All hints are identified with the two greater-than symbols like this one.

» All hints apply to all distributions equally, unless mentioned.

Logging in on a virtual terminal

In this section you are going to log in to the system using both text and graphical virtual terminals.

1.

If the install went correctly then you should now see a graphical login prompt. If this is not the case, ask your instructor to fix this. (You learn how to do this yourself later in the course.)

2.

Verify that you indeed have seven different virtual terminals. Cycle through them by pressing Alt-Fn, where n is the terminal number you want to access. Use Ctrl-Alt-Fn when you are in a graphical terminal.

» <Ctrl-Alt-F1>

» <Alt-F2>

» <Alt-F3>

» <Alt-F4>

» <Alt-F5>

» <Alt-F6>

» <Alt-F7>

3.

In your first virtual terminal (tty1), log in to the system with your own username which you also configured when installing the system.

» <Ctrl-Alt-F1>

» Login: (your username)

» Password: (your password)

4.

In your second virtual terminal (tty2), log in to the system as root. After having logged in, look at the command prompt. Do you notice anything different from the command prompt in the other virtual terminals?

» <Alt-F2>

» Login: root

» Password: ibmlnx

5.

In your seventh virtual terminal (tty7), log in to the system with your own username and password.

» Login: (your username)

» Password: (your password)

6.

Open a terminal window. Take a look at the command prompt. Does it differ from the command prompt on tty1? Why or why not?

© Copyright IBM Corp. 2001, 2006

Exercise 3. Using the System

3-5

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

» On a Fedora or Red Hat system, a terminal window can be started from the “Red Hat” button in the upper left hand corner; System Tools; Terminal. You can also drag this icon to your quick launch bar, if you want to.

» On a SuSE system, the terminal icon can be found in the launch bar.

Basic Commands

In this section we are going to execute some basic commands, in order to familiarize yourself with the command syntax of Linux, and the fact that you are currently on a multi-user, multi-tasking system.

All commands in this section are executed on virtual terminal seven (the graphical login prompt where you are logged in as yourself), using the terminal window you just opened, unless specified otherwise.

7.

Change your password. Memorize this password because no one can find out your password if you forget it.

» $ passwd

» Changing password for <username>

» (current) UNIX password: (your current password)

» New UNIX password: (your new password)

» Retype new UNIX password: (your new password)

» passwd: all authentication tokens updated successfully.

8.

Display the system's date.

»

$ date

9.

Display the whole calendar for the year 2007.

» $ cal 2007

10. Display the month of January for the year 1999 and 99. Are 1999 and 99 the same?

» $ cal 1 1999

» $ cal 1 99

11. Generate a list of all users present on your system.

» $ who

- OR -

» $ finger

12. Display your login name.

» $ whoami

- OR -

» $ who am i

13. Display the login information of your own user account, and of root.

» $ finger <username>

3-6

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

» $ finger root

14. Clear your screen.

» $ clear

15. Print the text Out to lunch on your display.

» $ echo Out to lunch

16. Make sure you are willing to receive messages

» $ mesg y

17. Write the message Out to lunch to the display of root. Check whether root got the message.

» $ write root

» Out to lunch

»

<Ctrl-D>

»

<Ctrl-Alt-F2>

»

<Alt-F7>

18. Write the message Out to lunch to the display of all users. Check whether everybody on your system got the message.

» $ wall

» Out to lunch

» <Ctrl-D>

» <Ctrl-Alt-F1>

» <Alt-F2>

» <Alt-F7>

Keyboard and Mouse Tips

19. The bash shell has a command history function. View some of the commands you have entered. Try to alter one of these commands, then run the command again.

» <arrow up>

» <arrow down>

20. Your terminal has a buffer that keeps track of the output of your commands. View the output of the previous commands.

» <shift page-up>

» <shift page-down>

21. Bash supports command and filename completion with the TAB character. Try to use this feature, both on commands and on filenames.

» $ pass<TAB>

» $ cat /etc/pass<TAB>

© Copyright IBM Corp. 2001, 2006

Exercise 3. Using the System

3-7

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

22. Both in a text terminal and an emulated terminal in the graphical desktop, try to re-execute commands by scrolling up a little, selecting the command with the left mouse button, and then pasting it onto the same terminal again with the middle mouse button.

Also try this across different text and graphical terminals.

Note: SuSE does not enable gpm by default, so your mouse won’t work in a text terminal when you are using SuSE.

Using the history

23. Use the history command to view the last 20 commands you typed.

» $ history 20

24. Execute one of the commands from the history list.

» $ !2

25. Execute the echo command again, this time changing the word “lunch” to “dinner”.

» $ !echo:s/lunch/dinner/

26. Bash also supports searching in the history. Try this feature as well.

» $ <Ctrl-R>cle

Locking terminals

Note: Not all distributions install vlock and xlock by default. If vlock and xlock are not installed, then you learn how to do that in Exercise 15 - Basic System Configuration.

27. Lock a virtual terminal. Can you switch to another virtual terminal while this one is locked? Unlock the terminal.

» <Ctrl-Alt-F1>

» $ vlock

» <Alt-F2>

» <Alt-F1>

» Type your password or the root password ibmlnx to unlock the terminal

28. Lock the console. Can you switch to another virtual terminal now? Unlock the console.

» $ vlock -a

» <Alt-F2>

» Type your password or the root password ibmlnx to unlock the console.

29. Lock the graphical environment and then unlock it again.

» <Ctrl-Alt-F7>

» $ xlock

3-8

Linux Basics and Installation

© Copyright IBM Corp. 2001, 2006

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V2.0

Instructor Exercises Guide

EXempty

- OR - Click the padlock icon - OR Use the “Lock Screen” function in your “Start” menu.

» Type your password to unlock the graphical environment.

Logging off

30. Log off all users that are logged in at any TTY.

» <Ctrl-Alt-F1>

» $ exit

» <Alt-F2>

» $ logout

» <Alt-F7>

» Click on the GNOME or KDE button and select “Log out”

END OF EXERCISE

© Copyright IBM Corp. 2001, 2006

Exercise 3. Using the System

3-9

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

V2.0

Instructor Exercises Guide

EXempty Exercise 4. Working with Files and Directories

What This Exercise Is About

This exercise provides the students with the opportunity to begin working with directories and the files they contain.

What You Should Be Able to Do

At the end of the lab, you should be able to:

• Work with directories

• Work with files

• Work with files and directories recursively

• Work with binary files

© Copyright IBM Corp. 2001, 2006

Exercise 4. Working with Files and Directories

4-1

Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Instructor Exercises Guide

Exercise Instructions

Working with directories

1.

If you are not logged in as yourself at tty7, log in now. Make sure you’ve got a terminal window open.

2.

Check the directory you are placed in. What directory is this?

3.

Change your current directory to the root directory (/).

4.

Verify that you are in the root directory and then execute both a simple and a long listing of the files in that directory.

5.

List all files in the current directory and list all files in the current directory and below.

Note: This command provides extensive output. Once you have seen enough, end