Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

286 Chapter 8 Study Guide

Lab Exercises

Lab 8-1 Using the VI editor

The objective for this hands-on lab is to gain experience in using the VI editor. You should be able to use any distribution of Linux for this installation exercise.

1.Log into a Linux system with only user rights.

2.Use VI to create a simple text file.

3.Practice using the common commands within VI.

4.When you’re comfortable with the VI editor, open a system file for editing. Be sure to back up the file first.

5.Save the file after editing.

6.Restore the previous file.

7.Repeat as needed until you’re comfortable with the VI editor.

Lab 8-2 Adding a hard drive

The objective for this hands-on lab is to gain experience installing a hard drive, partitioning it, creating a file system, mounting it, and editing a system file to use the newly created file system. You should be able to use any distribution of Linux for this installation exercise.

1.Install a hard drive.

2.Partition the hard drive.

3.Create a file system on the drive.

4.Mount the file system.

5.Edit the system file to auto mount the newly created drive on boot.

Answers to Chapter Questions

Chapter Pre-test

1.PATH is used to set the directories searched for any command entered.

2.TERM environment variable is used to set name of the terminal, console, or display-device type to be used.

3.The swap file should be configured to support the system memory and user applications.

Chapter 8 Study Guide 287

4.The inittab file is normally stored in the /etc directory.

5.The fstab file is normally stored in the /etc directory.

6.A basic editor included with Linux is VI.

7.Multiple shells can be used on the same system and even by the same user.

8.BASH (Bourne Again SHell) is the shell, or command language interpreter, for the GNU operating system and is standard for most Linux systems.

9.Before editing any system files, you should back them up to a safe location first, so that you can recover the original if you make an error.

10.The main use of a shell is to provide services, including command and filename completion, command line editing, history commands and events, detailed shell operational control, and aliasing.

Assessment Questions

1.B. Typically, the size of the swap file should be twice the size of installed RAM. For review, see the “Adding Hardware” section.

2.B. The command cp fstab fsold backs up the fstab file. The others won’t work to back up the file. For review, see the “Memory” section.

3.C. The <esc> key is used to exit edit mode in VI. The others are used to perform different VI functions. For review, see the “VI” section.

4.D. The command string that will exit VI without saving the changes is: q!. The : w! overwrites the file and the others are not used. For review, see the “VI” section.

5.B. The mkswap /dev/<partition> command is used to activate the swap partition. The other commands don’t activate the swap partition. For review, see the “Swap” section.

6.C. The options for IDE drive addressing are Master, Slave, and Cable Select — not only Master and Slave. The numbering system 0-7 and 0-15 are used

in SCSI addressing. For review, see the “Adding a hard drive” section.

7.B. The SCSI ID that matches sdc is 2. SCSI ID 1=sdb, 3=sdd, and 4=sde. For review, see the “Adding a hard drive” section.

8.B. There are 8 SCSI IDs on a narrow SCSI bus. For review, see the “Adding a hard drive” section.

9.D. There are 16 SCSI IDs on a wide SCSI bus. For review, see the “Adding a hard drive” section.

10.A. The mkfs command is used to create file systems. The cfdisk command creates partitions, linuxconf is used to configure the Linux system, and format is not a standard Linux command. For review, see the “Adding a hard drive” section.

288 Chapter 8 Study Guide

11.B. The daemon that processes print requests is the line printer spooler daemon. For review, see the “Printers” section.

12.D. The fstab file is used to automatically mount file systems. The others are not functions of fstab. For review, see the “Adding a hard drive” section.

13.C. The /etc/inittab file is used to perform the default state and terminal connections for a Linux system. The inittab file does not perform the other functions. For review, see the “Configuration files” section.

14.D. The env command will display the current active shell. The others are not used to verify the active shell. For review, see the “BASH” section.

15.A. The line SHELL=/bin/bash indicates that the BASH shell is the default shell. For review, see the “BASH” section.

16.B. The bashrc file is usually located in the /etc directory. It is not normally in the other directories. For review, see the “BASH” section.

17.D. The . bashrc file is usually located in the /home/username directory. It is not normally in the other directories. For review, see the “BASH” section.

18.A. The function of the . bash_profile file is to provide login initialization commands. For review, see the “BASH” section.

19.D. The function of the . bash_logout is to provide logout functions. For review, see the “BASH” section.

20.B. The function of the . bashrc file is to provide shell configuration commands. For review, see the “BASH” section.

Scenarios

1.The use of multiple shells is supported and can be configured by placing the appropriate files in the user’s home directory and creating the proper configuration files. For review, see the “BASH” section.

2.You should install the hard drive, partition the disk, create a file system on the partition, mount the partition, and add any additional configurations.

Administration

Administrating a Linux network environment will be a common task. You will have to add new users and

delete former users. You will also have to issue passwords and set the proper permissions for each user or group. The chapters in this part detail the common tasks that an administrator must know how to perform in order to keep the network (and the users on it) running smoothly. Every day, you will have to use common shell commands; create, extract, and edit files; manage run levels; and even start, stop, and restart services. On the Linux+ exam, 18 percent is focused on administration but understanding the basic functions of the common administration commands and being able to navigate the Linux hierarchy will get you one step closer to being a Linux professional and passing the Linux+ exam.

P A R T

IV

In This Part

Chapter 9

General Linux

Administration

Chapter 10

Linux Terminals and

Shells

Chapter 11

Linux System

Commands

General Linux

Administration

EXAM OBJECTIVES

4.1 Create and delete users

4.2 Modify existing users (e.g., password, groups, personal information)

4.3 Create, modify and delete groups

4.4 Identify and change file permissions, modes and types by using chmod, chown and chgrp

4.5 Manage and navigate the Linux hierarchy (e.g., /etc, /usr, /bin, /var)

4.6 Manage and navigate the standard Linux file system (e.g., mv, mkdir, ls, rm)

4.8 Mount and manage filesystems and devices (e.g., /mnt, /dev, du, df, mount, umount)

C 9H A P T E R

292 Part IV Administration

CHAPTER PRE-TEST

1.Creating a user normally requires what information?

2.Creating a group of users normally requires what information?

3.What commands or programs are most often used to create users?

4.What commands or programs are most often used to create groups?

5.What are the common directories in Linux?

6.What commands are used to manage and navigate files and directories?

7.What commands are used to mount and manage file systems?

8.What commands are used to identify and manage file permissions?

9.Which of the commands that are used to manage users, groups, directories, file systems, and permissions, do not require the use of root privileges?

10.What commands can be used to manage users and files without the need for root access?

Answers to these questions can be found at the end of the chapter.

Соседние файлы в предмете Операционные системы