Download as pdf or txt
Download as pdf or txt
You are on page 1of 493

RH033 Introduction to Red Hat Linux Series

Introduction to Red Hat Linux I

Instructors: Dee-Ann LeBlanc


and Matt Bacchi

www.digitalthink.com

© DigitalThink, Inc. All rights reserved.


Module 1:
Lesson 1 - Course Introduction
Lesson 2 - Introduction
Sidebar: Open Source Software (OSS)
Sidebar: Red Hat® certification
Lesson 3 - Using the Linux labs
Sidebar: Using the Linux labs (Simulation transcript)
Lesson 4 - Introduction to Red Hat® Linux and the GPL
Sidebar: About GNU GPL
Sidebar: GPL and the Free Software Foundation
Sidebar: The Linux community of developers
Sidebar: Benefits of a packaged distribution
Lesson 5 - Prerequisites
Lesson 6 - What you need
Lesson 7 - Course resources
Sidebar: Copying and pasting on UNIX platforms
Lesson 8 - Your learning community
Lesson 9 - Meet your instructors
Sidebar: Welcome! (Audio transcript)
Lesson 10 - The course project
Module 2:
Lesson 1 - Installing Red Hat Linux
Lesson 2 - Hardware compatibility
Sidebar: Determining what your hardware is
Sidebar: Minimum hardware requirements for Linux
Lesson 3 - Creating an installation boot diskette
Sidebar: Editing your BIOS to boot from a CD-ROM
Sidebar: Building a Linux boot disk in Windows
Sidebar: Creating an installation boot diskette (FlipBook transcript)
Quiz: Hardware compatibility
Lesson 4 - Linux installation methods and installation types
Sidebar: Direct vs. upgrade install
Sidebar: The text-based installation method
Sidebar: Installation types (MouseOver transcript)
Exercise: Installation methods
Lesson 5 - The Workstation dual-boot system
Lesson 6 - Partitioning strategy
Sidebar: Planning partition size (Mouseover transcript)
Lesson 7 - Partitioning the hard drive
Sidebar: Linux Native and Linux Swap filesystems
Sidebar: Partitioning screen (Flipbook transcript)
Lesson 8 - Planning swap space
Lesson 9 - Installation demonstration
Sidebar: How to make your Linux installation easier
Sidebar: Installing a Linux GNOME Workstation (Simulation transcript)
Lesson 10 - Language, keyboard, and mouse selection
Sidebar: About dead keys
Sidebar: Configuring the keyboard, language and mouse (Simulation transcript)
Lesson 11 - Network setup and the Time Zone selection screen
Sidebar: Configuring the time zone and network settings (Simulation transcript)
Lesson 12 - Account configuration and X configuration
Sidebar: X configuration of monitor and video card (Simulation transcript)
Lesson 13 - Final preparation for install and aborting the installation
Exercise: Installing Linux
Lesson 14 - Module wrap-up
Exercise: GNOME Workstation installation
Module 3:
Lesson 1 - Getting started with Red Hat® Linux
Sidebar: Other options for running Linux
Lesson 2 - Red Hat® and the Linux operating system
Sidebar: The connection between Linux and UNIX operating systems
Quiz: Red Hat® Linux and the history of Linux
Lesson 3 - Users, groups, and superusers
Sidebar: Users, Groups, and Superusers (FlipBook transcript)
Exercise: Users, groups, and superusers
Lesson 4 - Logging on to a Linux account
Lesson 5 - Working with the GUI interface and opening a terminal window
Sidebar: Window manager choices
Sidebar: Options for closing a window
Sidebar: Working with a window (MouseOver transcript)
Lesson 6 - Changing your password
Exercise: Lab: system logon
Lesson 7 - Getting online help with the man page utility
Exercise: Lab: getting online help
Lesson 8 - The GNOME desktop environment
Sidebar: Using the GNOME desktop (Simulation transcript)
Quiz: The GNOME desktop environment
Lesson 9 - Editing text files and logging off
Sidebar: Editing text files (Simulation transcript)
Exercise: Lab: logging off
Lesson 10 - Module wrap-up
Quiz: Reviewing the introduction to Linux
Module 4:
Lesson 1 - Understanding the Linux Filesystem
Sidebar: Today's Windows filesystem
Lesson 2 - Introducing the Linux filesystem
Sidebar: Linux filesystem hierarchy (Mouseover transcript)
Exercise: The Linux filesystem
Lesson 3 - Typical Linux directory structure and Linux system directories
Lesson 4 - User directories and the home directory
Lesson 5 - The GNOME file manager
Sidebar: Opening GMC (FlipBook transcript)
Lesson 6 - Using GNU Midnight Commander
Sidebar: A tour of GNU Midnight Commander features (MouseOver transcript)
Lesson 7 - Using GMC to sort files
Sidebar: Use GMC to display and sort files (Simulation transcript)
Exercise: Use GMC to display and sort the contents of your home directory
Lesson 8 - Moving through the filesystem
Sidebar: Changing directories (FlipBook transcript)
Exercise: Lab: change directories on the command line
Lesson 9 - Investigating the Red Hat® Linux filesystem using ls and pwd
Lesson 10 - Exploring file types
Sidebar: Common mistakes when naming files
Lesson 11 - Determining the file type in GMC
Lesson 12 - File and directory manipulation
Sidebar: Creating files and directories (FlipBook transcript)
Exercise: Lab: exploring the directories on your system
Lesson 13 - Module wrap-up
Quiz: Linux filesystem
Module 5:
Lesson 1 - Using special characters
Lesson 2 - Wildcard special characters
Exercise: Special characters
Lesson 3 - Other important special characters
Lesson 4 - Command line uses for the special characters
Sidebar: Examples of two useful commands
Exercise: Lab: using special characters
Lesson 5 - Using special characters with GMC
Sidebar: Using special characters with GMC (FlipBook transcript)
Lesson 6 - Using double quotes to prevent interpretation of special characters
Sidebar: Double quotes and special characters (FlipBook transcript)
Exercise: Using double quotes
Lesson 7 - Module wrap-up
Exercise: Understanding special characters
Quiz: Special characters
Module 6:
Lesson 1 - File manipulation and location
Lesson 2 - Creating and moving files and directories
Exercise: Lab: creating and moving files on the command line
Lesson 3 - Copying and removing files and directories
Sidebar: Copying and deleting files at the command line and in GMC (FlipBook
transcript)
Exercise: Lab: copying and removing files and directories on the command line
Lesson 4 - Viewing text files using less, more, cat, head, and tail
Sidebar: Viewing first and last lines of a file using cat, head, and tail (FlipBook
transcript)
Exercise: Lab: viewing text files using less, more and cat
Lesson 5 - Manipulating process output
Sidebar: Introduction to /dev/null
Exercise: File redirection and using pipes to connect processes
Exercise: Lab: file redirection
Lesson 6 - Use the slocate, find, and which commands
Exercise: Lab: finding files using slocate and find
Lesson 7 - Using grep to find search strings
Exercise: Lab: using grep to view text files
Lesson 8 - Module wrap-up
Quiz: Module review
Module 7:
Lesson 1 - File access permissions
Lesson 2 - Linux file access permissions
Sidebar: Example of permissions (Mouseover transcript)
Quiz: How to use permissions in Linux
Lesson 3 - Changing permissions from the command line
Sidebar: Using numeric values and changing permissions (Simulation transcript)
Exercise: Lab: numeric and simple commands
Lesson 4 - Linux file security overview
Sidebar: Linux file security (FlipBook transcript)
Exercise: Permissions
Lesson 5 - Changing permissions with GMC
Sidebar: Changing permissions with GMC (FlipBook transcript)
Lesson 6 - Module wrap-up
Quiz: Review of file access permissions
Module 8:
Lesson 1 - Using the pico text editor
Lesson 2 - Introduce the pico text editor
Lesson 3 - Launching pico
Sidebar: Opening pico in GNOME
Lesson 4 - Editing a document
Lesson 5 - Cutting, copying, and pasting using pico
Exercise: Lab: using the edit, copy, and paste features in pico
Lesson 6 - Saving and quitting
Exercise: Lab: using cut, copy, paste, quit, and save in pico
Lesson 7 - Getting help in pico
Exercise: Lab: using the help feature in pico
Lesson 8 - Module wrap-up
Quiz: Module review
Module 9:
Lesson 1 - The shell as a working environment
Lesson 2 - What is the shell?
Sidebar: The shell and what it does (FlipBook transcript)
Lesson 3 - Available shells in Linux
Sidebar: Command line editing
Exercise: Shells and their abbreviations
Quiz: Available shells
Lesson 4 - The bash shell
Sidebar: Bash in UNIX
Sidebar: The shell history feature
Exercise: Review shell features
Lesson 5 - Shell variables
Lesson 6 - Quoting special characters
Sidebar: Quoting special characters (Simulation transcript)
Exercise: Lab: quoting special characters on the command line
Lesson 7 - Recall and use previous commands
Sidebar: Ways to use the history command (Simulation transcript)
Lesson 8 - Module wrap-up
Quiz: Review: the shell as a working environment
Module 10:
Lesson 1 - Printing, file packaging, and miscellaneous commands
Lesson 2 - Printing in Linux
Sidebar: Print utility (FlipBook transcript)
Lesson 3 - Printing PostScript and ghostscript data
Sidebar: Postscript and ghostscript (FlipBook transcript)
Lesson 4 - Printing from applications
Sidebar: Printing from an application (FlipBook transcript)
Lesson 5 - Printing from the command line
Exercise: Printing from the command line
Lesson 6 - Querying and canceling
Sidebar: Querying and canceling (Simulation transcript)
Lesson 7 - Accessing filesystems from the command line
Sidebar: Using the Mount command (Mouseover transcript)
Lesson 8 - Accessing DOS diskettes
Lesson 9 - Why archive files?
Sidebar: Tar (FlipBook transcript)
Lesson 10 - Working with archives
Lesson 11 - File compression
Sidebar: Using file compression and file compression utilities (FlipBook transcript)
Lesson 12 - Gzip and archive compression
Sidebar: How to use gzip (FlipBook transcript)
Exercise: Lab: file compression and file compression utilities
Lesson 13 - Module wrap-up
Quiz: Printing, file packaging, and miscellaneous commands
Module 11:
Lesson 1 - Course project
Lesson 2 - You're the installation expert
Exercise: Completing a dual-boot installation using Disk Druid
Lesson 3 - Files, directories, and permissions
Exercise: Manipulating files
Lesson 4 - Course conclusion
Sidebar: Way to go! (Audio transcript)
Lesson 5 - Where do you go from here?
Lesson 6 - We'd love your feedback
Lesson 7 - Course survey
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction
Welcome to Red Hat® Linux and the world of Open
Source Software (OSS). Whether you're an experienced IT
professional or just starting out, if you like to solve problems
and build things, and you like technology that is powerful
and enabling, you're in the right place!

Linux growth Linux is fast growing in popularity as a server for the Web:
in commercial Internet Service Providers, corporate intranets, e-commerce
use sites, and other commercial applications. Even IT executives
who in the recent past shunned Open Source Software
(OSS), are beginning to understand that Linux is a powerful,
robust operating system for business-critical server roles, and
is also increasingly accessible to the desktop users.

About this Introduction to Red Hat Linux I introduces students to the


course command line environment, Linux operating system
architecture and concepts, and the tools and techniques
needed to navigate and maintain a Red Hat Linux system as a
productive Linux user.
The course begins with what may seem intimidating to new
users: Red Hat Linux installation. It then continues with an
overview of the history of Linux and Open Source Software
(OSS) development.

Thirdly, this course teaches you how to work with all the
major commands and features of Red Hat Linux. You will
learn which commands to use and how to edit system files in
order to optimize your system. You will learn how
permissions work and why they are fundamental to your
understanding of the power of Linux. You'll learn about the
packages that come with Red Hat, and how they are used.
Lastly, we'll discuss the networking utilities available to the
power user, and how you can use these to automate your
system, to make time for exploring and learning more about
what Linux has to offer.
Course goals After completing the course, you will be able to:
● Install Red Hat Linux on standard and nonstandard
hardware
● Navigate and use the Linux filesystem

● Perform common file maintenance tasks

● Use and customize the GNOME interface

● Issue essential Linux commands from the command


line
● Perform common tasks using the GNOME GUI

● Explain and implement file and directory access


permissions

● Customize the X Window System

The series This course, Introduction to Red Hat Linux I, is the first of
two courses in the Introduction to Red Hat Linux Series (RH
033). Introduction to Red Hat Linux I explores the Linux
installation process, how Linux sees the files and directories
on its hard drive, and how Linux handles multiple users.
Specifically, it teaches you how to install Linux, navigate the
filesystem, work as a user, and manipulate the filesystem.

First-time students: To get the most out of this course, take


the Course Orientation.

Series features The following features are included in this series to better
prepare you to apply your skills in a real-world environment.

Easy On the Resources page, you will find a folder titled Easy
Reference Reference. The Easy Reference folder contains a variety of
checklists, tables, and questions that are presented or
mentioned in the course.
You can print these resources as they are mentioned in the
course, or you may download them all at once from the
Resources page, where they are listed by topic.

To print the Easy References one-by-one from within the


course, click on the Easy Reference icon, then use one of the
following print commands: Windows (use Ctrl-P); UNIX
(use Alt-P); Macintosh (use -P).
For a printable version of the content, click the Easy Reference
folder icon.

QuickChecks QuickChecks are unscored opportunities for you to


self-check your understanding of key points before you
arrive at an Exercise or Quiz that is scored.

There are two kinds of QuickChecks. Click once to see the


question, then click again to see the correct answer in a short,
animated sequence.

A QuickCheck may also give you an opportunity to review


commands and answer the question on a simulated command
line. When you have completed your answer, press Enter,
and the solution and a brief explanation are displayed in a
separate pop-up window. Try it now.

Your first lab When you're working in the lab, you will be working in your
exercise home directory. In order to get you started, we've set up your
filesystem for you with files and directories in your home
directory.

This arrangement will begin to make sense as you learn to


navigate the Linux file structure.
For purposes of the lab, you will have your own user name. Where
you see the default username redhat, please use your own user
name in its place. For example, if your username is leed, and the
instructions ask you to cd to the /home/redhat directory, you
will enter the command cd /home/leed.

Lab We've discovered that if you truly wish to master a skill,


problem-solver nothing beats hands-on experience. To provide an
exercises opportunity to practice what you learn within a context, we
have created exercises throughout the series in which you
apply your knowledge to various scenarios.
We've included the lab feature to give you an opportunity to
try these exercises in a live environment. You’ll learn more
about how to use this exciting feature in a later lesson.

Although solutions to the problem-solver exercises will be


submitted to tutors, you should also consider using the
Discussion area as a forum for sharing responses.

On Your Own This course includes a number of On Your Own exercises.


exercises You will be able to complete these exercises outside of the
Linux lab, and on any Linux system running X Windows, the
Linux Graphical User Interface. Although these exercises
are not submitted to a tutor, your tutors are available to
answer questions. In addition, we recommend that you use
your peers as a resource by taking advantage of the
Discussion area.

Next lesson In the next lesson, you'll learn more about the origins of
Linux, the history of Red Hat, and more about why Linux
has grown so rapidly, including background on the Free
Software Foundation and the GNU Public License (GPL).

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using the Linux labs
Use the Linux labs.

About the
Linux labs
In order to use the lab feature, you need to connect to it
using an SSH (Secure Shell) client. You'll learn more about
SSH in this lesson.

Creating your Before you use the lab, you'll need to create your account.
account You do this by clicking on the Create Account button. An
account will be created for you, using your DigitalThink user
name and password. In order to keep our system secure, you
may be required to change your password when you log on.
Be sure to make a note of your password!
Click the Create Account button below now to create your
Linux account.

Frequently By taking advantage of the lab feature, you will greatly


asked enrich your learning experience. This list of frequently asked
questions questions is also available from the Resources page.
How can I access the lab?
Once you have created your account, you will use an SSH
client to connect to the Linux lab. If you are behind a
firewall, you may need to check with your systems
administrator before installing and using SSH.
What is SSH?
The SSH client is a separate program that you install on your
computer. SSH provides a secure terminal connection from
your computer to the computer running the Linux lab. SSH
and SSH compatible programs run on Windows 98/NT/95,
Macintosh, and all major UNIX platforms.
Where can I get the SSH program?
Although versions of the SSH client for Windows 98/NT/95,
Macintosh, and all major UNIX platforms are freely
available on the Internet, you may need to do some digging.
Visit the Resources page for additional information on where
to obtain a free copy of SSH.
How do I use SSH?
To access the Linux labs using SSH, you will need to launch
this application as you do any other program. Although the
screen will vary depending on what version of SSH you are
using, it will look something like the one in the simulation
below.
Use the simulation below to try it on your own!

Transcript

What is the lab Host Name?


In order to connect to SSH, regardless of what what version
of SSH you are using, you will need to provide the machine
name or Host Name. The Linux lab machine name is:
labs2.digitalthink.com
What are my password and login ids?
You will log in to the labs using your course login id and
password. For security reasons, you may be required to
change your password the first time you log in.
What do I do if I accidentally erase my files in my project
directory?

The user directory structure (as shown below) is the default


structure for all users. Since your files are not backed up, we
recommend you make copies of important files and store
them in a separate directory. You will learn how to backup
files in a later module.

Your first lab When you're working in the lab, you will be working in your
exercise home directory. In order to get you started, we've set up your
filesystem for you with files and directories in your home
directory. Click the View Image button now to see what the
arrangement looks like.
This arrangement will begin to make sense as you learn to
navigate the Linux file structure.

Reminders If you're new to the Linux environment, you'll need to


remember the following when using the labs.
● UNIX is case sensitive: UNIX is not the same as unix
or Unix.
● Your password will not be visible when you enter it.

It is not important for you to be familiar with the finite


details of every command you will learn in this course.
However, it is imperative that you apply what you've
learned. Making the most of the lab feature will greatly
enrich your learning experience. Above all, it will give you
an opportunity to explore.

Next lesson In the next lesson, you'll learn more about Red Hat®, Open
Source Software (OSS), and the GPL.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course introduction
Open Source Software (OSS)
Open Source Software (OSS) means that the source code as
well as the binary (the actual program you run) is accessible
and distributed freely.

Open Source Software may be downloaded for free, or


packaged and sold in CD-ROM format with value-adds such
as documentation, extra tools, and of course all the
engineering and Quality Assurance that must be done to
ensure Red Hat®'s quality distribution. Most Open Source
Software is covered under a public license. The most
common public license is the GNU General Public License
(GPL).

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course introduction
Red Hat® certification
Introduction to Red Hat® Linux I is the first course of a
two-part series, titled Introduction to Red Hat Linux.
This series will complete your preparation for the next
four-part series in the Red Hat curriculum, Red Hat Linux:
System Administration.

For more information on other courses that can help you gain
Red Hat certification, please visit the course catalog page.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat® Linux and the
GPL
Explain the origin of Red Hat Linux and the Open
Source Software movement.

You'll find out more about the origins of Linux later on in


the course. For now, we'll discuss why the roles of the Free
Software Foundation, Open Source Software (OSS), and the
GNU GPL are so important to the Linux community.

Origins of As you may know, Linux began as a POSIX-compatible


Linux kernel developed by Linus Torvalds in 1991 as the core of a
"free" operating system. Linus began development of the
Linux kernel while he was a student at the University of
Helsinki, and he continues his leadership among the Linux
kernel programmers today. The Linux kernel is the core of
the operating system, which is contributed to by Red Hat,
and supported when used as part of Red Hat Linux.

GNU General Open Source Software (OSS) can be freely seen, modified,
Public License and improved by anyone who uses it. Linux was created this
way. So was the Internet--a technology owned by no one,
and to which everyone can contribute. Linux is considered
free software, but it is not in the public domain. It adheres to
the GNU General Public License (GPL), which says that it
can be freely distributed or even sold, but must always be
accompanied by its source code as well as a copy of the
GNU GPL license.
OSS and GPL The concepts of free software that costs nothing and free
software that everyone can view are often confused. OSS is a
more recent phenomenon than free software. As it is
currently defined by the GNU GPL, "free" software does not
necessarily mean it costs nothing. On the contrary, while
distributing software covered by this license a vendor must
make the source code freely available to the buyer, but it can
charge a fee for the distribution media and the vendor
services and support that it also provides.

How the GPL The GPL allows anyone to modify the source code covered
works by the license, and to distribute derived products as long as
the original source is made available. Open Source Software
(OSS) gives users the ability to modify the code to suit their
own needs, which is not possible with proprietary software
code.

OSS is the reason behind the amazing speed at which Linux


development occurs. OSS is extremely flexible: depending
on how it is used, there are zero licensing costs, the
community provides very fast bug fixes, and it is rich in
features and functionality.

Red Hat, Inc. Red Hat, Inc. is the largest Open Source company in the
and Red Hat world. Red Hat was founded on the belief that the open
Linux discourse of ideas holds the greatest potential for business
and human development.
Red Hat introduced its comprehensive package-based
distribution of Linux and Linux resources in 1994. Since
then, Red Hat Linux has grown to be the most popular and
widely used Linux distribution. Red Hat Linux and the
Apache Web server are especially popular with Internet
Service Providers and for other network resources and roles.
Red Hat supports the growth and evolution of Linux by
employing more Linux developers and open source engineers
than any other company, and committing large resources to
developing open source code while continuing to adhere to
the GPL.
This is just one of many ways in which Red hat distinguishes
itself from other companies and products on the market. Red
Hat is the leading Linux and open source company providing
enterprise-class support and services, consulting, training,
and technology alliances with all the leading hardware and
software OEMs.

Professional users of Red Hat Linux rely on Red Hat's


consistent leadership and its support of open source to bring
them the technologies they use to solve serious computing
and internetworking challenges. By using Red Hat Linux
official products, users benefit from the high quality and
broad range of services promised by the Red Hat brand.

The Red Hat Red Hat's distribution of Linux includes installation and
distribution configuration software, the latest version of the Linux kernel,
and common utilities and applications.
Red Hat adds value to the base Linux components by
packaging, engineering, QA, and other product quality
assurance methods. Red Hat backs up the Red Hat Linux OS
with comprehensive technical support and a complete range
of services, training, and consulting. Because of the large
installed base of Red Hat Linux systems around the world
Red Hat acts as a standardizing force in the diverse Linux
community.

The Red Hat Linux package is available on CD-ROM, and


comes with a free copy of the Red Hat Installation Guide.
Although Red Hat freely distributes the same software via ftp
from mirror sites around the globe, the download is
extremely time consuming, so most people elect to purchase
Red Hat Linux, which also gets them the added values that
only come with purchase of official Red Hat Linux product.

Linux for the Recently there has been a focus on making Linux more
desktop functional for non-technical users. This has been
accomplished with desktop environment efforts for GNOME
and KDE, two easy to configure graphical environments
available in Linux. These projects make the Linux desktop
more accessible, allowing someone who has little experience
outside of Microsoft Windows to be comfortable in the
Linux environment.

Next lesson In the next lesson, you'll learn about prerequisites to this
course.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Access the Linux labs using SSH
Using the Linux labs (Simulation
transcript)
1. Click in the host window and type in the name of the
machine you are connecting to:
labs2.digitalthink.com. Although Telnet is selected
by default, we are using SSH. Select the SSH radio
button and notice that the TCP port changes.
2. Because SSH runs on a different port, the port has
switched automatically. Click Open.
3. This shows the SSH authentication screen. For
purposes of this simulation, enter the user name
redhat, and hit Enter to move to the next line.
4. For security reasons, when you enter your passphrase
(or password), it does not appear on the screen. In our
example, the passphrase has been entered for you. Hit
Enter to continue.
5. You are now connected to the labs. When you are
ready to disconnect, click the x in the top right corner
of the screen to exit the program.

6. When the Exit Confirmation warning window appears,


click OK to terminate your session. This completes the
simulation.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Prerequisites
Verify you have the right background for this
course.

You need not have any experience with Linux to take this
course.
However, you should have some familiarity with computers.
To get the most out of this course, you should be able to use
a mouse and the keyboard, and understand the basics of PC
hardware.
More specifically, you should have experience with
Microsoft Windows or another operating system.
If you do not have this experience, you should at least have a
rudimentary understanding of the following concepts:
● Data (information) is stored on a hard drive.

● Every PC has basic hardware elements.

If you don't have this knowledge, consider taking a basic computer


skills course.

Next lesson In the next lesson, you'll learn what you need to take this
course.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat® Linux and the GPL
About GNU GPL

The GNU General Public License (GPL) was developed in


1991 by Richard Stallman, an advocate of free software who
founded the Free Software Foundation (FSF). GNU is a
self-referential acronym for "Gnus, Not UNIX!"

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat® Linux and the GPL
GPL and the Free Software Foundation
The GNU General Public License (GPL) was developed in
1991 by Richard Stallman, an advocate of free software who
founded the Free Software Foundation (FSF).

Stallman used the concept of "copyleft" to protect the


freedom of GNU project software, effectively reversing the
use of copyright law to ensure that GPLed source code
would never be closed. This early effort to secure freedom in
distributing and viewing the source code has led to the
popular Open Source Software initiative.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat® Linux and the GPL
The Linux community of developers
Linux consists of a worldwide community of developers who
have written drivers, features, and new functions--all
working under the GNU GPL. These developers all
communicate via the internet, exchanging ideas, methods,
code, and expertise. The internet itself is powered by data
communications protocols (IP, TCP, UDP, DNS, HTTP, etc.)
which are themselves open source, based on open standards.
Linux and open source power the Internet and in turn the
Internet powers Linux and open source development.

Since 1991, Linux has developed into a full-blown


computing environment with a worldwide developer base of
thousands of users.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat® Linux and the GPL
Benefits of a packaged distribution
Many Linux packages must have co-requisite requirements
that demand dependencies: some packages depend on others,
while other packages such as programming libraries are
critical to basic system functionality. In 1994, Red Hat®,
Inc. has devised a scheme called RPM, the Red Hat Package
Manager, to transparently handle package installation,
removal, upgrades, and dependencies for a system
administrator.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
What you need
Learn what you need to take this course.

Platform
support
You can take this course on Windows, Macintosh, or UNIX
platforms. However, to complete the exercises in this course,
you will need to access the lab feature.

Download Red You can download the Red Hat Linux operating system for
Hat® Linux for free from ftp.redhat.com. But be warned: the Red Hat servers
free stay pretty busy. If you can't connect, or want to download
from a site closer to you, try one of the many mirror sites
around the world. A link to the mirror sites can be found on
the Resources page.

Purchase Red Alternatively, if you'd rather not make decisions about which
Hat Linux components to download--a process that is time consuming
and requires intimate knowledge of the hardware
environment into which Linux is to be introduced--you can
buy the CD-ROM, and have it delivered to your doorstep.
There are several advantages to purchasing a boxed set of the
Red Hat Linux operating system. They include the following:
● Service and support: A variety of options are
available.
● Software: This includes both the Red Hat Linux CD
and the Red Hat Linux source code CD.

● Documentation: This includes the Official Red Hat


Linux Installation Guide and the Official Red Hat
Linux Documentation CD.

Additional information is listed on the Red Hat Web site.


Monitor The simulations in this course require a minimum monitor
resolution desktop area of 800x600. If your resolution is set lower than
this, some of the simulation windows may be too large to fit
entirely on your screen.

Next lesson In the next lesson, you'll learn about course resources.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course resources
Explore course resources.

There are numerous resources offered with this course that


will help you to complete it successfully. The greatest
resource is the Course Orientation, which you should take
right now if you haven't already. There, you'll learn what to
expect with regard to course structure, interactivity, and
assessment.

In addition to the Orientation, there are several other


resources available to you. You'll come across those listed
below as you progress through the course.

Resources and You can find Web links, printable tables, lists of
Help pages hardware-compatibility standards, installation checklists, and
recommended textbooks for this course on the Resources
page. Remember, you can reach the Resources page at any
time throughout the course by clicking the Resources button
on the toolbar. And if you have questions, assistance is
always available on the Help page.

Glossary Throughout this course, you'll have the opportunity to review


definitions of key terms. These terms are defined in the
course glossary. The terms appear as blue, italicized, and
underlined in the lesson text. Clicking a glossary term opens
a pop-up window with the definition. You can try it now.

We encourage you to use the course Syllabus frequently. From the


Syllabus, you can go to any lesson in this course. You can also
find out how far you have progressed in the course and how much
more you have to go before finishing a module or the course itself.
To access the Syllabus, just click the Syllabus button in the
toolbar.
Course Purchase the optional text for this course online by visiting
bookstore the course Bookstore page. This book is not required to take
this course, but it does contain helpful, additional
information.

Course file You can download the entire course from the Resources
page. This file provides the lesson, quiz, and exercise content
so you can read and review the course material offline at
your convenience. Although this file is not required to
complete this course, we strongly recommend that you
review the course material offline, and practice what you've
learned in a live environment.

This file is available in PDF format. You will need Adobe


Acrobat Reader 3.0 or greater to view a PDF file. If you don't
have Acrobat Reader, you can download it from the Adobe
Web site.

Exercise After completing some exercises, you will be required to cut


submissions and paste your source code into a text submission box.
Copying and pasting is generally easy to accomplish, but
sometimes on UNIX platforms, this may require a
workaround.

Next lesson In the next lesson, you'll learn about your learning
community.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Your learning community
Find out about the members of your learning
community.

Learn from
other students
As you proceed through this course, you'll have ample
opportunity to communicate with other students taking this
very course. There are four principal ways to access this
virtual community. These are described in the table below:

Method Description

Discussion Post questions and responses to questions posed by other


students. There are several topic-specific discussion
folders. Why not click on the Discuss button to view them.

Chat Talk with other students who are visiting the Chat area at
the same time, or even schedule a time for an online study
group.

Classmates Search profiles of your classmates.

Messenger Establish real-time communication with other students by


sending instant messages.

We encourage you to take advantage of all these tools, as


each will enhance your learning experience. To find out
more about how these tools work, return to the Course
Orientation you took earlier. Or experiment with the toolbar
to find out what each of these features offers and how they
differ.
Introduce Discussion
yourself Throughout the course, you'll have several opportunities to
participate in a discussion about Linux, and to learn from
your peers. Why not initiate the discussion feature right
now? Introduce yourself to your classmates by posting a
message in the discussion area. Tell your classmates who
you are, and what you hope to get out of this class.

Tutors Another way to share your ideas and get feedback on the
work you do in this course is through your tutors. The course
tutors are experts in the subject of this course. They may
review your exercise submissions and respond to them by
email if the exercises so require. You can also email the
tutors whenever you have a question or get stuck in a lesson
or exercise.

How to send Let's walk through the process of sending email to your
email to the course tutors.
tutors 1. Click the Tutor button on the toolbar.
2. The WebMail page appears. Type something in the
Subject field.
3. Type your email message in the Message field.
4. Click the Send Message button. The WebMail
response page appears.

5. Click the browser Back button twice to return to this


page.

Next lesson In the next lesson, you'll meet your instructors.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course resources
Copying and pasting on UNIX platforms
All the text files you need to get started on course exercises
are included in the download file available on the Resources
page. Open the text file in your text editor and make any
modifications necessary to complete the exercise. Save the
file under a different name.

From text Once you have the exercise solution in a text file, you're
editor to ready to submit your solution to the course tutors.
browser
Some configurations of UNIX operating systems make it
difficult or impossible to copy and paste between
applications. To work around this, you'll need to open your
exercise solution text file in your Web browser, select and
copy the text, then paste it into the exercise submission text
area of the learning environment.

How to... If you find you cannot cut and paste text from one
application to another, follow the steps listed below.
1. When you are ready to submit an exercise solution,
navigate to the appropriate exercise page in the course
using the course syllabus. You'll notice a text box in
which you'll want to paste your exercise solution.
2. From the File menu in your browser, choose the Open
Page option. The Open Page dialog box appears.
3. Click the Choose File button. The Choose File dialog
box appears.
4. Navigate to the appropriate directory and select your
exercise solution text file. The name of your text file
will now appear in the Open Page dialog box.
5. Click the button that opens the page in your browser.
The text file will now appear in the browser window.
6. Select the text of your exercise solution and choose the
Copy option from the Edit menu.
7. Click the browser's Back button to return to the course
Exercise page.
8. Position your mouse cursor in the exercise submission
text box, click the mouse, and then select Paste from
the Edit menu. Your solution text is now ready to be
submitted to the tutors.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Meet your instructors
Get to know your instructors, Dee-Ann LeBlanc and
Matt Bacchi.

Dee-Ann Dee-Ann is a qualified Linux author, instructor, and


LeBlanc consultant in the Vancouver, BC, Canada area. Dee-Ann's
fascination with computers dates back to sixth grade when
she was first introduced to the Commodore Pet; she has been
involved with Linux system administration since 1994.
Dee-Ann attended Penn State University, where she attained
her degree in General Arts and Sciences Human Studies
Option and completed most of the Mechanical Engineering
program. She is also a qualified Red Hat Certified
Engineer™ (RHCE™) and has been an online instructor
since 1997, teaching Linux and UNIX, CGI, and JavaScript.
Transcript Dee-Ann has worked with major firms/educational
institutions including ZDU, Digital Education, LANWrights,
and The Coriolis Group, and spends much of her time
writing computer related articles and books, including a
regular column in Linux AppDev on integrating Linux with
other operating systems.
She also makes time for writing fiction and playing with her
dog, Zorro.
Dee-Ann has been a contributing author of the following
books:
● Linux System Administration Black Book from The
Coriolis Group
● General Linux Level I Exam Prep from The Coriolis
Group
● Linux Install And Configuration Little Black Book
from The Coriolis Group
● Using Eudora; Second Edition from Que Publishing

● Running A Perfect Internet Site With Linux from Que


Publishing
● The Internet CD Tutor from Que Publishing
● Using Eudora from Que Publishing

Matt Bacchi Matt Bacchi is a Systems Integrator at IBM where he is


responsible for the integrity of large AFS and DFS
distributed file systems, as well as Tivoli Storage Manager, a
distributed workstation backup tool. Before joining IBM,
Matt worked for a small Internet service provider and as a
consultant on an electric vehicle demonstration project. Matt
has used Linux in its many forms for five years and has been
involved in testing Linux on PowerPC and RS/6000
hardware. He is also a founding member of a local Linux
user's group.

Matt's other interests include hiking the Appalachian Trail,


skiing in the Green Mountains, and environmental issues.

Next lesson In the next lesson, you'll learn about the course project.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The course project
Learn about the project you will be completing at
the end of this course.

To better prepare you to work in the Linux environment,


feel more comfortable with the installation process, and use
the commands that are important and useful in maintaining
your system, we have created an optional course project for
you.
The course project consists of two exercises. The first is an
installation exercise. You will be asked to plan a Linux
installation based on information provided in a resource
folder: hardware inventory, online resources, and elements of
a planning strategy. More specifically, in the first exercise
you will be asked to explain your decisions and respond to
information presented to you regarding your hardware,
partitioning, and more. In the second exercise, you will
troubleshoot a permissions-related problem.
In each exercise, your tutors will evaluate your solutions.
In both exercises, you will have a set of resources to help you
respond to the problems in question. These resources include
the following kinds of information.
● Hardware inventory

● Email

● Online resources

● Planning strategy

You will find these in the Resources file, which looks like
the one below.
With each response, you will get feedback from a tutor about
your solutions to the problems presented.

Coming up Next, you'll begin the first part of the course.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Meet your instructors
Welcome! (Audio transcript)
Welcome to the world of Linux! In this course, you'll
learn about commands you'll need to operate and navigate
your Linux system. Whether or not you have some
experience with Linux or UNIX or are starting from scratch,
this course will give you a comprehensive overview of the
commands you'll need to use to maintain your system. In
addition, we have provided numerous checklists, tables, and
sites that will round out your learning.
We strongly recommend that you review this material
offline, and practice these commands in a live environment.

This is an exciting operating system, and an even more


exciting community once you start investigating it. Once you
learn to find your way around, we're confident you'll find it
hard to go back to using anything else!

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Installing Red Hat Linux
Module introduction
If you like working with computers, chances are you'll love
working with Linux! This highly customizable operating
system invites you to get under the hood and tweak things as
much as you'd like. This is one of the reasons Linux is a
challenge to work with, but also what makes it so exciting.
Linux has strong ties to open source, and this is one of the
reasons for its surge in popularity. Another reason is that
installing Red Hat® Linux has become far easier than the
days when the files had to be positioned by hand.
In the past, Linux required the user to be familiar with the
complexities of the system in order to install it successfully.
While the growing number of tools and utilities available for
users can make software selection a daunting task, the actual
installation of Red Hat Linux today is a pretty
straightforward process.
The secret of a successful install is to know some basic
information about the hardware and to understand the
importance of planning in order to avoid common mistakes.
Once you are comfortable within the Linux operating system,
and realize how much fun Linux is, you will want to see
what other tools are available.
This module introduces you to Linux, and teaches you what
you need to know in order to successfully complete a Red
Hat Linux installation.
After completing this module, you will be able to:
● Describe hardware compatibility issues

● List the steps in creating an installation boot diskette

● Describe Linux installation methods and installation


types
● Describe how partitions are used to improve data
integrity, and explain how the Disk Druid partitioning
tool is used
● List the considerations in planning swap space
● List the steps required in installing a Linux GNOME
workstation.
● Describe how to select the default installation and
system language, keyboard, and mouse configuration
● Describe how to configure the network and select a
time zone
● Describe how to use the Account Configuration screen

● Describe how to prepare for and abort an installation

Next lesson Linux is compatible with a wide variety of PC hardware. The


next lesson describes hardware compatibility and installation
boot diskettes.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Hardware compatibility
Describe hardware compatibility issues.

Hardware
compatibility
Although most hardware available for the PC platform is
requirements Linux-compatible, the importance of planning your Linux
installation cannot be overemphasized. A successful
installation is directly related to how well you know your
hardware.

Planning your Verifying that your hardware is compatible can save you
installation undue stress in installing your system. However, it is
important to do this before (and not during) the installation
process. The best place to find out about hardware
compatibility with Linux is to start with the Hardware
Compatibility Guide, which contains a complete list of
Linux-compatible hardware. By carefully consulting this list
early on, you avoid having to replace newly purchased items
that are incompatible with your system. In addition to the
Hardware Compatibility Guide maintained by Red Hat®,
Inc., there is the Hardware-HOWTO document.

Link to the Red Hat Hardware Compatibility Guide and the


Hardware HOWTO documentation from the Resources page. Once
your system is installed, you can find the HOWTO document in
the /usr/doc/HOWTO directory.
Determining In order to establish whether your system meets the
what hardware minimum requirements for Linux, you will need to first
you have determine the exact hardware you have on your machine.

There are several ways to determine this information:


1. Review manufacturer and model information
2. Check your receipts
3. Consult the manual

4. Search the Web

Minimum Compared to other operating systems, Linux requires


requirement next-to-nothing in terms of hardware, but you will need to
specifications meet certain minimum requirement specifications.

If you intend to use the GUI interface heavily, you will want a
faster machine (faster CPU) with more RAM than the minimum
recommended specification.

There are two types of hardware compatibility requirements


to keep in mind when installing Linux: CPU and hard drive,
and the default device drivers.
CPU and hard drive
Linux requires a certain amount of processing power (speed,
or the CPU), memory (RAM), and hard drive space. If you
intend to use the GUI (Graphical User Interface) interface
heavily, you will want a faster machine (faster CPU) with
more RAM.
Default drivers
In order to install Linux, you need to have the correct drivers
for your hardware. The Red Hat Linux distribution comes
with a wide range of drivers by default. If yours are not
included in the default Red Hat Linux distribution, you will
need to obtain these drivers from an outside source. Some of
these are listed below:
● Your Linux distribution's Web site

● The hardware device's manufacturer's Web site

● Some of the sites listed on the Resources page


● Other Linux distributions' Web sites

You can verify exactly what drivers are required by


consulting the Hardware Compatibility List provided by Red
Hat.

Doing your Although you will learn about the actual Linux installation
research: tips process in more detail later in this module, there are certain
on trouble- hardware-related issues to consider in planning your
free installation.
installation
As you now know, one way to avoid installation problems is
by consulting the Hardware Compatibility Guide. Another is
to avoid devices that are likely to be incompatible with your
system. These might include:
● Very new devices incorporating very new technology

● Plug and play devices

● Devices "optimized" for other operating systems

Each of these potential hardware-incompatibility issues is


discussed below in more detail.

Very new Installation problems may come from a newly released


devices device (sometimes referred to as bleeding edge hardware)
that may not yet have drivers for Linux. For example, video
cards using brand new technology often encounter this
problem.
In some cases, it may be possible to use a driver from an
older version of the device until a newer driver is available.
You may also be able to use a generic driver that provides
basic functionality without any of the features specific to the
model. While this means you have to wait to use the
whiz-bang aspects, it at least means that you can use the
device right away.

There are advanced techniques that allow you to install brand


new drivers that are not included in the distribution. For now,
you will learn how to use the tools directly at hand, rather
than those that have to be downloaded.
Plug and Play Other devices that require some research before installation,
devices include Plug and Play devices. Plug and Play is not fully
supported by the Linux kernel. This means that a Plug and
Play device such as a sound card or modem may not be
compatible with your "out-of-the-box" version of Red Hat
Linux. There are some exceptions, including the PCI Sound
Blaster sound card. For other exceptions, review the
Hardware Compatibility List.

Devices A third hardware compatibility issue to anticipate with Linux


"optimized" installation is that hardware specifically designed for a
for other non-Linux operating system probably will not work with
operating Linux. This would include devices "optimized" for other
systems operating systems, such as Windows™. For example, many
people discover too late that the Winmodems modem only
works with Microsoft Windows.

Considering In summary, hardware incompatibility becomes an


compatibility installation consideration long before the actual installation
before process begins. Always review the Hardware Compatibility
installation List before you purchase new devices, including Plug and
Play devices and hardware specifically designed for
non-Linux operating systems.

Fortunately, as Linux becomes more popular, hardware support is


rapidly increasing in all areas. The greater the demand for Linux,
the harder hardware manufacturers will work to ensure that Linux
users can use their devices.

Methods to In order to install Linux, your system needs access to the


install Red Hat installation files. There are five different methods to install
Linux Red Hat Linux. In each case, the installation documentation
is co-located with the installation files, and a special
installation boot diskette may be required.
1. CD-ROM
2. FTP: On a remote FTP site
3. HTTP: On a remote HTTP site
4. Local hard drive: On the local machine on a DOS
drive
5. NFS: On a central server on the network, or on an
outside Linux network, and loaded onto the machine
over the network
If you do not have a CD-ROM drive attached to your
machine, or if you wish to install on a cluster of machines
using a single CD-ROM, then an NFS network install is
usually a good choice.

You will learn how to do network-based installations in a


later course.

Next lesson As you may have guessed, the most popular install method
for Red Hat users is the CD-ROM. In the next lesson, you'll
learn more about the installation boot diskette mentioned
earlier, such as when you need it and when you can do
without it.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
List the steps to create an installation boot
diskette.

Installing from
CD-ROM
As we've seen, there are multiple ways to install Linux.
Regardless of whether you boot from a disk or the CD-ROM
itself, the most convenient, the fastest, and by far the most
common method of Linux installation is to use a CD-ROM.
If a Linux-compatible CD-ROM drive is not available, there
are many other options for installing Linux.

Booting from If you don't have a CD-ROM drive, you can boot from a
an installation specially created boot diskette to begin the installation
disk process. As we learned in an earlier lesson, in order to
complete the install, you'll need drivers for common devices;
the system will need to retrieve these from the boot diskette.
If you're installing on a laptop and are using an external
CD-ROM drive, you'll be using something called a PCMCIA
device, and will need a second diskette.

Reasons to There are several situations in which it might be necessary to


boot from a boot from an installation disk. For example, perhaps rather
disk than purchasing a boxed version of the distribution from a
brick-and-mortar store or from Red Hat®, you bought just
the distribution Red Hat Linux Operating System CD-ROM,
or even downloaded it yourself. If your machine cannot boot
from its CD-ROM drive, then you will have to make an
installation floppy.
Skip the All of the data to start the installation process is available on
creation of the CD-ROM containing your Red Hat Linux materials. The
boot diskettes reason it is standard procedure to create boot disks is
historical; at one point in computer history, it was not
possible to boot a machine directly from the CD-ROM. You
had to do it from a floppy disk or the hard drive.

Most modern BIOS chipsets allow you to update the device


boot order so you can alter which media your machine looks
at as it starts up, and thus allow you to boot directly from the
CD-ROM. This feature, combined with the boot capability of
the Red Hat installation CD-ROM, will allow you to skip the
creation of boot diskettes if your machine supports booting
from this drive.

Be sure after the installation that you change the BIOS back to
booting from the other drives.

If you're running Windows, and you don't have Linux


installed yet you'll need to know how to build a Linux boot
disk in Windows. View the steps it takes now.

Building a In order to boot from an installation disk, you need first to


boot disk create one. You can build a boot disk using a disk image. An
using a disk image is all of the data necessary to create a boot disk; it
image must be copied onto the target floppy disk in the exact bit
and byte order in which it was created. The images you need
are provided on the CD-ROM in the /images subdirectory.
This is shown in the image below.
Building a You can make one of these disks either in Linux or in the
boot disk in MS-DOS/Windows operating system. In Linux, the dd
Linux command can copy the data image to the floppy drive. This
command has two important parameters:
● if stands for infile (the image)

● of represents the outfile (the floppy)

The steps to create a disk in Linux are described in the


FlipBook below:

Transcript

The PCMCIA helper diskette is created in a similar manner.


You will need to replace boot.img with pcmcia.img.

Comparing dd Of the two methods described in the FlipBook above, the dd


with cat command is far more commonly used because it is more
widely taught, and is "native" to UNIX. With both the dd
and cat methods, you are guaranteed that every byte's
location on the floppy will match the image. Either command
may take thirty seconds or more to complete.

Building a Installation boot diskettes can also be created from the


boot disk in MS-DOS/Windows operating system (version 3.21 and
MS-DOS/ higher) by using the rawrite.exe utility. This program
Windows is located in the dosutils directory on the installation
CD-ROM.
Be sure to read the documentation file rawrite3.doc before using it
for the first time.

Trouble- Lastly, as you've probably guessed, the installation can be a


shooting tricky process. The following View Table describes a list of
toolkit common troubleshooting issues. Keep this document handy
when doing your install.

For more information on installing using other media, check


the Resources page for a link to the Red Hat Installation
Guide.

Next lesson Choosing an installation method is easy. You'll learn how to


do this in the next lesson.

Quiz
Before moving on to the next lesson, click the Quiz button to
test your understanding of Linux and hardware compatibility.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
Determining what your hardware is
How do you determine what hardware you have? There are
four methods that you can use to determine exactly what
hardware you have in your machine. These methods are
listed in more detail below.

The device If you have Windows 95 or 98 installed you can find your
manager tab hardware under Device manager tab in the system properties
from control panel. This saves you the trouble of opening
your box and may give enough information for a linux
install.

Check The most reliable way to determine your hardware is to find


manufacturer manufacturer and model information on the equipment itself.
and model This information is commonly available on monitors and
information keyboards, but is not always included on some motherboards
and cards. Discovering what is in your machine requires that
you actually open up your machine and take a look. This is
an intimidating experience for some users. If you are
uncomfortable with this, first consider the other methods.

Check your If you still have the receipts from the purchase of your
receipts machine, there may be an itemized list of what you have
installed. Be careful of this method, though. These lists are
not always accurate. If you get your information this way and
the installation process does not work as expected, you may
need to use another method to double-check the hardware in
the machine.
Consult the An alternate way of seeing what you have is to look at the
manual manuals that came with the computer. This method, of
course, requires that you still have the manuals and that you
can still find them. Also bear in mind that sometimes
manufacturers use the same base manual for a number of
different models. This is a problem. While it narrows down
your information, the base manual is not of much use if you
do not know exactly which model you have. At the very
least, you can play with your settings and try those for each
model until you get things working.

Search the Internet search engines are also a good place to turn to. If
Web there is no specific model information, but there is some kind
of numeric code on the hardware, then you can try doing a
Web search on that code and seeing if it turns up anything
instructive.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
Minimum hardware requirements for
Linux
The minimum hardware requirements for Linux are
described below.

Feature Minimum requirement Description

The CPU (or Central


Processing Unit) is your
computer's brain; the chip
on your motherboard does
the "thinking." A "Pentium"
CPU 386
actually describes the
machine's processing
power, or how fast the CPU
thinks: a Pentium is a 586
CPU chip.

The hard drive is where


500MB (850MB is information is physically
Hard drive recommended for a stored on your computer;
Workstation install) this is where files are saved
and programs installed.

RAM is your computer's


memory. The more RAM
you have on the
motherboard, the more
processes you can run at
once and the faster most
programs will run. This is
RAM 16MB not to be confused with
VRAM, which is the RAM
on your video card, or with
the small EPROM chip that
holds the tiny bit of memory
that keeps your BIOS
(system settings) for boot
time.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux installation methods and
installation types
Describe Linux installation methods and
installation types.

Now that you know how to create an installation disk, you


now need to learn about the direct and indirect installation
methods and the classes of installation, including the
Workstation, Server, and Custom installation. You'll learn
more about these methods in this lesson.

Linux If you're installing Linux for the first time on your machine,
installation you're doing a direct install. Once the installation medium
methods has booted, a selection screen is displayed. From this screen,
you may choose the most convenient and appropriate method
to install Linux, as shown in the View Image.

Further information on the installation methods is available by


pressing F2. Details on expert installation are available by pressing
F3, on KickStart with F4, and on passing kernel parameters with
F5.

Choosing the The default method is a graphical install. This will start
default method automatically if after one minute the user has made no entry.
Alternatively, you can invoke this method simply by pressing
Enter at the boot: prompt. There is also a text-based
method. For purposes of this course, we will concentrate on
the graphical installation method.
Installation The steps to initiate a direct install in graphical mode are as
steps follows:
1. Simply press Enter at the boot: prompt. By pressing
Enter at the boot: prompt, you will boot the kernel
and then start an X server to continue with the
GUI-based installation.

2. A wizard will guide you through the installation


procedure, asking you to select the following:
language to use during installation, keyboard layout,
mouse type, and installation type.

If you need help in selecting the correct option, use the contextual
help in the left pane. To switch off this feature, click the "? Hide
Help" button.

Classes of In addition to the first (or direct) and upgrade installation,


installation there are different classes of installation. Each of these
classes (or levels) has different hardware requirements, and
is best suited to specific tasks.
The available classes are Workstation, Server, and Custom.
You should select a different class of installation based on
your needs. For example, if you wish to install Red Hat®
Linux with a general selection of network services and
servers, you would select the Server class installation.
All of the installation classes offer to install LILO, the LInux
LOader. This tool helps your machine boot properly into
Linux. LILO is used where you need to boot into one of two
operating systems, for example, a machine running both
Linux and Windows.
The MouseOver below describes each installation class in
detail, including a description of each class, the free space
requirements for each, as well as the kinds of circumstances
in which each install would be appropriate.
Transcript

For a printable version of the above table, click the Easy


Reference folder icon.
Note that in addition to installing various software packages, both
the GNOME and KDE Workstation class installations will
automatically remove all Linux-related partitions (unless you
chose Partition manually) on all installed hard drives. The Server
class install removes all Linux AND non-Linux related partitions
(unless you choose Partition manually) on all installed hard drives.

The Any time you see partition size referred to with the terms
"growable" "remaining space" or "of at least", that partition's size is not
option firmly set. This "growable" option is only invoked for
partitions that do not have to conform to a specific base size;
it is especially useful when you know the minimum partition
size but would like to allocate more space to some partitions.
The "growable" option is really a way of saving you from
doing exact calculations.

How the Here's how the "growable" option works. Once all of the
"growable" partition base sizes are accounted for, you may be left with
option works room for Linux either on your hard drive(s) or in the areas
you've set aside for Linux. If there is room left over, the
installer resizes or "grows" the partitions that are "growable"
so that they take up all of the remaining space that is
available for Linux. However, when you are doing one of the
Workstation or Server installs, you do not get to choose
which partitions are growable unless you partition the drive
yourself.

You would not use growable for the /boot or swap partition.
Package You might be curious about how long it takes for each of the
installation installation methods to complete. There are a number of
speed issues involved with package installation speed:
● The speed of your CPU

● How much RAM you have

● How many packages you selected

● How fast your network is, if you are doing a network


install

Taking these factors into account, it is not surprising that the


installation time can vary from machine to machine. It may
take hours in some cases, and can be done in under an hour
in others, particularly for a reduced Custom installation.

Next lesson Partitioning your hard drive provides a way to divide the
contents of your Linux file system and to share a hard drive
between multiple operating systems. We'll discuss the
various methods of partitioning your hard drive in the next
lesson.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete an exercise on installation methods.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
Editing your BIOS to boot from a
CD-ROM
Editing your If you wish to boot from the CD-ROM (or find out if it is
BIOS possible for you to do so), you need to edit the machine's
initial boot instructions, which are contained in the BIOS.
To edit your BIOS:
1. Reboot your machine.
2. Follow the instructions for entering Setup or BIOS;
this usually means pressing the Delete key.
3. Find the option set that contains the boot-order setting.
Often this menu choice is BIOS FEATURES SETUP.
4. Find the specific option that you need to set. You can
recognize it by its listing of drive letters. Often, this
option is Boot Sequence.
5. Change the boot sequence so the CD-ROM drive is
listed first.

6. Save and exit the BIOS. The machine will reboot and
check the CD-ROM drive before any other drive,
allowing you to boot from this drive.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
Building a Linux boot disk in Windows
1. Insert the Red Hat CD-ROM into the CD-ROM drive.
2. Insert a floppy disk into the floppy disk drive.
3. Open the Explorer file manager in Windows.

4. Navigate to the section containing the CD-ROM's


contents.
For purposes of this example, we'll assume this is D:

If you see D: elsewhere in these steps and yours is a different


directory letter, change it accordingly.

5. Navigate into the dosutils directory.


6. Double-click on the rawrite program. It opens a DOS
window with the following text in it:
Enter disk image source file name:
7. Type d:\images\boot.img and press Enter. The
following text appears:
Enter target diskette drive:
8. Unless your floppy drive is somewhere else, type a:
and press Enter. The following text appears:
Please insert a formatted diskette
into drive A: and press -ENTER-
9. You already have the disk inserted. Press Enter. Your
computer now creates the boot floppy for you. This
process is quite resource-intensive, your machine will
be slow to process other requests until it finishes.

10. When the title bar for the DOS window says Finished
and the disk drive stops whirring, the write is done.
You can take out the CD-ROM and the floppy now.
Label the floppy as the installation boot disk.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating an installation boot diskette
Creating an installation boot diskette
(FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Hardware compatibility
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.

1. Which of the following tools can you use to create a boot floppy in Linux?
Please select all the correct answers.
A. cat
B. rawrite
C. dd
D. fdisk
E. Disk Druid

2. What settings do you have to edit in order to be able to boot from the
CD-ROM drive?
Please select the best answer.
A. CMOS
B. RAM
C. VRAM
D. BIOS

3. Which two kinds of hardware are likely to cause problems during an


installation?
Please select all the correct answers.
A. Newly released three button PS/2 mice
B. Newly released sound cards
C. Newly released monitors
D. Newly released video cards

4. Of the answers listed below, which is the first to address when preparing to
install Linux?
Please select the best answer.
A. Check your hardware against the Hardware Compatibility List
B. Set your BIOS to disable Plug and Play
C. Set your BIOS to boot from the CD-ROM
D. Add a new hard drive for Linux

5. Of the Linux installation methods listed, which is the most common for a
standalone machine?
Please select the best answer.
A. NFS
B. CD-ROM
C. HTTP
D. FTP

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The Workstation dual-boot system
List the considerations for a dual-boot system

The
Workstation
As you know, it is possible to install Linux and Windows
dual-boot on the same machine. This means that you can boot either
system into Linux or Windows--or any other operating system
sharing the hard drive(s). This is done using LILO, the Linux
Loader, or another boot manager.

If the Windows operating system is detected on another


partition during installation, the Workstation class
installation configures the system to dual boot.

Reasons to There are a number of reasons to consider a dual-boot system


consider a for a Workstation install:
dual-boot ● Limited capacity: only one machine available on
system which to install Linux
● Limited space: limited space for multiple machines

● Multiple Linux distributions: to experiment with


multiple Linux distributions and have them installed
all on the same machine

● Linux test drive: to experiment with Linux rather than


completely switch over

Considerations If you've decided to set up a dual-boot system, you'll need to


when setting consider several important questions. These are described in
up for dual more detail below.
boot 1. Does my system have sufficient space available?
2. Do I have a tool to rearrange the drive on which I plan
to install Linux?

3. Do I wish to reinstall Windows before I install Linux?


Hard drive Does the system have enough space available? The first thing
requirements to keep in mind is that the hard drive requirements stated for
refer to free Linux refer to free space. For example, if you have a 2GB
space hard drive that has another operating system and its data
installed, and is therefore 75 percent full, then you only have
approximately 500MB left for Linux.

In this example, to get Linux into this space, you would need
to do a Custom install. To do a GNOME Workstation install,
you would need to add a new hard drive.

Rearranging How should I re-arrange the hard drive? If you are adding
your drive for Linux on a hard drive that already has Windows installed,
dual-boot with then you need to group all of the Windows data before you
FIPS start setting aside space for Linux partitions. FIPS is a useful
tool that can non-destructively rearrange your drive for you.
FIPS comes with Linux and is also available on the Internet.

If you simply start repartitioning with a tool like Disk Druid or


fdisk, you will destroy much--if not all--of your initial data.

Check the Resources page for a link to a site where you can
download the FIPS tool.

Using LILO: The final question to ask is, "Should I reinstall Windows
installing or before I install Linux?" Regardless whether you are installing
reinstalling or reinstalling Windows on your dual-boot machine, you
Windows should always install Windows before you install Linux.

The boot loader Linux uses (LILO) resides in the Master


Boot Record (MBR) of your hard drive, which is where the
computer's BIOS looks once it finishes its part of the boot
process. Every version of Windows wipes the MBR clean
during the install process. For this reason, it is important to
install Windows before you install Linux to avoid problems.
Next lesson Learn about why you might need multiple partitions, and
how to plan your layout and partitioning strategy in the next
lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux installation methods and installation types
Direct vs. upgrade install
Direct install: A direct install occurs when you are installing
Linux for the first time on the machine, or are replacing the
current version of Linux.

Upgrade install: You upgrade install when Linux is


currently installed on your machine. The reason for doing an
upgrade install would be to update packages to the latest
version. In the upgrade install, partitions are neither created
nor deleted.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux installation methods and installation types
The text-based installation method
The text-based installation method used in previous versions
of Linux may still be selected. Simply type text at the
boot: prompt and press Enter. For purposes of this course,
we concentrate on the GUI Red Hat® install.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux installation methods and installation types
Installation types (MouseOver transcript)
Worstation
installations:

Server:
Custom:
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Linux installation methods and installation types


Installation methods
Objective
Match the appropriate installation method with the scenario described.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are three terms; their corresponding definitions are listed in the right column.
Click once on a term in the left column, then click once on the definition in the right column to make a
match.
When you think you have all of the terms and their definitions matched correctly, click the Done button
and you'll see whether or not you've matched the terms correctly--green lines mean the match is correct,
red lines mean the match is incorrect. If you didn't get the matches right the first time, click Clear to erase
your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Partitioning strategy
Plan your partition layout and strategy.

Considering
backup
System administrators typically like to use a number of
strategy partitions rather than a single large partition. The rationale is
that a problem with one partition resulting in data loss will
not affect other partitions. In addition, many backup
strategies are based on backing up an entire filesystem
(partition). Having multiple partitions provides more
flexibility for creating an effective backup strategy.

Choosing a You do not always need to concern yourself with how


partition partitions are laid out. While you always have to choose what
layout partitions you want to use when doing a Custom install, the
Workstation and Server installs handle partitioning for you.
However, you can select the Manually partition option in
order to set things up yourself with both the Workstation and
Server installs.

Required There are only two required partitions in Linux: / (also


partitions: root called root), and swap. A popular layout among many users
and swap is the following combination: /, swap, and /boot. You
will learn more about swap space in a later lesson.

If you use the scheme mentioned above, then two of these


three partitions will be mounted at their respective locations (
/ and /boot) in the Linux directory structure. Mount
points are not used for swap partitions. Users do not directly
access these special partitions, but the kernel does when you
run out of RAM (as virtual memory).
Partition As mentioned above, a popular layout among many users is
planning the following combination: /, swap, and /boot.
All of the issues discussed so far (installation class, number
of drives, and backup strategy) affect how you partition your
system. The /, swap, and /boot scheme described above
is sufficient for the majority of Linux workstation users.
However, Server installations may use a more detailed
partitioning scheme for improved security, administration,
and/or performance.

The MouseOver below provides a good starting point for this


basic partition planning. It lists and describes the commonly
created partitions, and others you may consider creating,
based on your needs. It also lists which partitions Linux
requires, discusses size considerations, and describes the
reasons to separate each from the main partition.

It is important to plan your partition sizes, although you


certainly can change things during the partition setup
process.
Transcript

With the exception of /boot, the root, /tmp, swap, /home, /usr
and /var partitions can always be larger than recommended. The
/boot partition should stay about 16MB.

Do not use /boot for everyday tasks. This is where your kernel is
located! If you did a lot of work in /boot, it would be too easy to
damage your startup or to lose your kernel.

Linux Native When you create partitions, you need to indicate what type of
and Linux filesystem they will contain. You assign two different
Swap filesystem types to Linux partitions. Your swap partition has
the type Linux Swap. Any partition that is not the swap
partition is created by default as the type Linux Native.
Letting Linux When you do a Workstation or Server installation, you can
partition for let Linux partition the drive for you. There are default sets of
you partitions created for both install classes so you don't have to
worry about the details. Use these schemes if you are
experimenting with the installation class, or if you are setting
up a simple end-user workstation. A workstation typically
does not need a fancy partitioning setup.

Next lesson In the next lesson, you'll learn about partitioning your hard
drive.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Partitioning the hard drive
Describe how the Disk Druid and fdisk partitioning
tools are used

Partitioning to
improve data
A hard drive is designed to store large amounts of data.
integrity Rather than place it all in one section of the drive, the drive's
storage area can be divided into separate partitions.
Partitioning improves data integrity, allows for a more
flexible backup strategy, and is something that Linux can
handle for you. This lesson is intended as a brief overview.
As you learn more about Linux, you'll learn more about
partitions and filesystem types. Later on in this module, you
will be able to apply what you have learned about partitions
in a simulated installation

Extended If you have a PC and you don't have SCSI hard drives, then
partitions you have an Integrated Drive Electronics (IDE) hard drive.
Up to four primary partitions can be defined for each IDE
hard drive. One primary partition can be further divided into
a number of extended partitions. Therefore, on one hard
drive it is possible (but not recommended) to have up to 16
total partitions (3 primary partitions, an extended primary
partition, and 12 logical partitions within that extended
partition).
Using Disk Disk Druid is available only during installations, and
Druid vs. fdisk provides an intuitive interface that will satisfy the
requirements of most users. The fdisk utility is also used
for partitioning. It is less intuitive but has some advanced
features that are not present with Disk Druid, such as the
ability to select the primary partition on which to place
extended partitions. However, for most user installations, it is
recommended that Disk Druid is used to create partitions.

Disk Druid is a graphical tool that allows you to partition


your hard drive. For this installation, you will use the Disk
Druid partitioning utility.

Partitioning To create a partition using Disk Druid, first choose the file
using Disk system type (Linux Native or Linux Swap), then identify the
Druid mount point (if it is not a swap partition), and select the
partition's size, and then proceed to the next partition.
Let's look at each of these stages in more detail. Click on the
Transcript
View Flipbook button to see each partitioning screen.

Next lesson Planning swap space is important to prevent your system


slowing down as it tries to manage its virtual memory. In the
next lesson, you will learn about swap space.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Partitioning strategy
Planning partition size (Mouseover
transcript)
1.

2.
3.
4.

5.
6.
7.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Planning swap space
List the considerations in planning swap space.

About swap
space
Swap space is the hard drive version of your computer's
memory (RAM). It is possible to run programs that require
more memory than the RAM you have in your machine.
When this happens, the data that normally would go to your
RAM goes to files in the swap partition.

Having swap in a separate partition rather than within the


root partition improves the speed and, more importantly, the
stability of Linux. The less RAM you have, the more Linux
must use the swap partition. Since RAM is far faster than
hard drives (chips vs. moving parts), more RAM is generally
the best way to inexpensively boost performance.

Price vs. Of course, there are limits to price vs. performance.


performance Currently, 64MB of RAM is considered the standard, but
128MB offers the best price/performance ratio. As expected,
servers and high-end workstations will likely have much
more RAM than a typical system.

Planning swap Guidelines for planning swap space:


space ● Allocate as much swap space as is practical, up to
three times the amount of RAM.
● If there are multiple drives, put the swap partitions on
more than one disk.

● Always add more RAM if you can!


Next lesson One of the advantages of Linux is that it provides a highly
customizable user interface. You'll learn how to install
GNOME in the next lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Partitioning the hard drive
Linux Native and Linux Swap
filesystems

The two major filesystem types used on disk partitions in


Linux are Linux Native, and Linux Swap. While filesystem
formatting is discussed in more detail in a later lesson, the
important point to remember here is this: you must set aside
single swap partition. Other partitions are Linux Native, and
might include the following : root (/), /boot, /usr, and
/tmp.
Linux Swap filesystem
Linux Swap filesystem type is a holding place for data. Data
is constantly switched back and forth (swapped) from
memory to the swap partition, (when there's no room in the
memory to hold it) and vice verse.

Linux Native filesystem


All of your other partitions should be Linux Native. These
are the filesystems that are formatted to hold and store data.
This is the filesystem that you work with directly.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Partitioning the hard drive
Partitioning screen (Flipbook transcript)
Click the following thumbnails to view the full-sized image.

Click the Add button to open the Create Partition


dialog box.

Identify the mount point if it is not a swap


partition.

Indicate the partition's size.

Choose the file system type (Linux Native or


Linux Swap).

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Installation demonstration
List the steps required in installing a Linux GNOME
workstation.

For the remainder of this module, we will review the


various stages of a basic GNOME Workstation installation in
Expert mode.
As you know, preparation is critical to a successful install.
There are several things you can do when preparing to install
Linux that will make your install easier. We're doing a
Workstation installation. This will use all available disk
space for Linux but will not overwrite existing, non-Linux
disk partitions. This means that you can keep an existing
operating system, such as Windows, and boot to either one.
We'll start our installation with a GNOME install in the
simulation below.

Transcript

Next lesson Selecting language, keyboard, and mouse configurations are


important for ensuring that your system functions as you
expect it to. You will learn more about these configurations
in the next lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Language, keyboard, and mouse
selection
Select the default installation and system language,
keyboard, and mouse configuration.

There are a number of small but important details to set up


during the installation process. In this lesson, you learn how
to set the installation/system language, and configure your
keyboard and mouse.

Testing your Click the View Image to see the keyboard configuration
keyboard screen. Select a model that is appropriate for your system.
configuration Select the keyboard layout you want, and select whether or
not you want dead keys enabled. Use the text field at the
bottom of the screen to test your configuration.

If you cannot find an exact match, choose the best Generic match
for your keyboard type (for example, Generic 101-key PC).

Selecting a Click the View Image to see the mouse configuration screen.
Mouse type You will need to choose the correct mouse type for your
system. To do this, select from the list of possibilities in the
installation screen. Often you will find an exact match for
your mouse. If you cannot find your particular mouse on the
list, select one of the Generic entries, or choose one with
which your mouse is compatible.
Serial mouse If the mouse connector at the end of the mouse cable plugs
or a PS/2? into a rectangular connector, you have a serial mouse; if the
connector is round, you have a PS/2 mouse. If you are
installing Linux on a laptop computer, in most cases the
pointing device will be PS/2 compatible.
We'll continue our installation by continuing with keyboard,
language, and mouse configuration, in the simulation below.

Transcript

Next lesson Time zones must also be configured in the install. You will
also need to consider other network-related issues, including
how you get your IP address information. Let's take a look.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Installation demonstration
How to make your Linux installation
easier
Remember, the key to a successful installation is planning.
Here are several considerations and quick tips that may make
your Linux installation easier:
1. Check all of your hardware against the Hardware
Compatibility List. This issue cannot be stressed
enough.
2. Give some serious thought to how you plan to use this
system. If you plan to experiment, you may need more
hard drive space and packages than you might
otherwise.
3. Ask your Linux-savvy friends for advice and to
perhaps lend a hand while you do the install.
4. Know that this is a vocal community, and all Linux
users seem to have an opinion; take advantage of this
peer resource, but bear in mind that some users are
more realistic than others.
5. Build a list of online and offline resources in which
you find useful information. This list may become
invaluable later.
6. If possible, have a separate machine connected to the
Internet that you can use to research any problems that
might arise.

For a printable version of the above list, click the Easy Reference
folder icon.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Installation demonstration
Installing a Linux GNOME Workstation
(Simulation transcript)
1. This is the first screen you see when you prepare to
install Linux. Press Enter to start the installation in
graphical (GUI) mode.
2. English has been selected as the default language to
use during installation. Click "Next" to continue. This
completes the simulation.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Network setup and the Time Zone
selection screen
Configure the network setup, and select a time
zone.

If your machine is connected to a network, then you need to


provide it with certain information so it can communicate
with other machines. This lesson covers how to enter this
networking information and also how to set your computer's
time zone.

Continue with the installation simulation below to configure


the network setup and time zone selection.

Even if your computer is not part of a network, you can enter a


hostname for your system. If you do not enter a name, your system
will be known as localhost.

Transcript
Next lesson The Account Configuration and X Configuration screens are
important because these are two parts of a Linux system that
most users encounter on a regular basis. In the next lesson,
you'll learn how to use the account configuration screen.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Language, keyboard, and mouse selection
About dead keys

The term "dead keys" is misleading. This refers to the fact


that non-English characters with accents over them are often
typed by quickly pressing multiple keys in a sequence. This
feature is switched on by default. If you can't remember the
last time you needed to be able to type such a combination,
then it's probably safe to disable this option.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Language, keyboard, and mouse selection
Configuring the keyboard, language
and mouse (Simulation transcript)
1. As in the previous simulation, English is the default
language; you do not need to do anything to configure
the language unless you wish to use something other
than English. Click Next to continue.
2. Often, you can use the default Keyboard setting. As
before, the Online Help panel is on the left. Click Next
to continue.
3. Your mouse has three buttons and a square plug. Click
the three-button serial mouse option to continue.
4. Now click Next.
5. You have now reached the Red Hat® Welcome
screen. Click Next to proceed.
6. Note that the GNOME Workstation install type is
selected by default. Click Next to continue.
7. The Remove data option is selected by default. Click
Next to continue.

8. You have now arrived at the Time Zone Selection


screen. We will continue time zone configuration in a
later lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Account configuration and X
configuration
Describe how to use the Account Configuration
screen.

Now you have selected a system language, keyboard and


mouse configuration, have configured your network setup,
and selected a time zone. The next step is to continue with X
and account configuration.

X refers to the X Window System, which is the underlying


software behind the GUI used in Linux.

X The first two screens in this section relate to getting your


configuration GUI to run properly. There are two different issues involved
here: the first is the information Linux needs about your
monitor; the second regards your video card, and is what tells
the installer exactly which X server you require.

Configuring You need to be very careful when setting up your X


your monitor information.
and video card
If some of your settings are wrong, it may not be critical. If
others are incorrect, you may permanently damage your
system.

For example, you do not run the risk of damage in indicating


to the installer that your video card has more memory than is
actually available. However, the XFree86 (GUI) server may
not start correctly if you specify more video RAM than you
actually have on the card.
If you select a monitor that exceeds the capabilities of the monitor
you actually have, then the current monitor could be overclocked
(worked too hard) and possibly damaged or destroyed.

Steps in You start with the monitor, then continue with video card
configuring X configuration.
1. Monitor configuration: In configuring the monitor,
you tell the installer which brand and model of
monitor you are using. Choose the appropriate generic
option if your specific hardware is not listed.
2. Video card configuration: Next, you will configure
the video card. Once again, if your specific brand and
model are not included, choose generic. Be sure to
have documentation that came with the card handy: if
you use the generic option, you will need to tell the
installer what the limitations of the card are.
Continue with the installation simulation below to configure
X, the monitor, and video card.

Transcript

Account Now that you have configured X, you can move on to your
configuration account configuration.
When you set up an account, you are required to enter and
confirm a root password. Root is the account that the system
administrator uses. Optionally, you can create user accounts
from the Account Configuration screen as well.

It is highly recommended to create your own user account,


and keep the root user only for system maintenance.

The root user has unlimited access to the entire system; for this
reason, use the root account only when you need to perform
system maintenance or administration tasks.
The Account The steps for navigating the Account Configuration screen
Configuration are shown in the image below.
screen
When selecting a root password, it is recommended that you use
an alpha-numeric (letters and numbers) password, and that you
include one or more special characters (!@#$%^&*). Often it is
helpful to use an acronym to remember the root password.

Next lesson Sometimes you may run into uncertainties about your
hardware or have some other reason to abort an installation.
You'll learn about aborting an installation in the next lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Network setup and the Time Zone Selection screen
Configuring the time zone and network
settings (Simulation transcript)
1. Screenshot shows the Network Configuration screen.
Student clicks on the Activate on boot button to trigger
the next screen
2. Click the Next button to proceed to the Time Zone
configuration screen.
3. To configure your time zone, click on the dot closest
to your own location. In this case, you are in Nome,
Alaska. Click that dot to proceed.
4. You now have your location selected. Click Next to
proceed to the Account Configuration screen.
5. You are at the Account Configuration screen. The
simulation stops here for now.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Final preparation for install and
aborting the installation
Abort an installation.

Aborting the
installation
Even with careful planning, there may be times when you
are about to commit to an install and realize that you forgot
something vital.
For example, while doing a Server installation, you decide to
allow the installer to write over your old Windows data.
However, just as you are about to write over your data, you
realize that you need to rescue a file. Or perhaps you had
trouble researching your hardware and need to do further
investigation before you fully trust your installation choices.

In these situations, it is advisable that you abort the


installation process. If you wish to do this, you need to
reboot before your hard drive is rewritten.

Steps to abort Read and follow each of these steps carefully:


the installation 1. Eject the boot floppy if you are using one
process
2. Press the Restart button on your computer

3. During the reboot process, eject the CD-ROM

If you do not carefully follow these steps, you will directly boot
back into the installer.
You abort an installation from the About to Install screen.
Click the View Image button to see this screen.

This is your last chance to cancel the installation process


before your partitions are filled with files. Click the Back
button if you want to review your choices, or press
Ctrl-Alt-Delete or your computer's reset button to reboot the
machine.

Next lesson The next lesson wraps up this module.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice installing Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Account configuration and X configuration
X configuration of monitor and video
card (Simulation transcript)
1. When you set up the GUI or display settings, you must
first configure the monitor. For purposes of this
simulation, you are using a MAG Innovision™ brand
monitor. Click the + next to MAG to proceed.
2. You are using a MAG Innovision AX15FG monitor.
Find your monitor within the brand, and select it.
3. Click Next to continue.
4. The horizontal and vertical sync values for this
monitor are now displayed. Click Next to continue.
5. Now you will need to configure your video card. You
are using a simple 3DLabs Oxygen GMX™ video
card. Click that card to select it from the list.
6. You have 1MB of VRAM (video RAM) on your video
card. Click the 1024K radio button to continue.
7. Now, test the configuration to make sure you have it
right. Click the Test this configuration button to
continue.
8. The message "Can you see this message?" is now
displayed on the screen. This means that the test
worked. Click Yes to continue.
9. The installer returns you to the X Configuration
screen. Click Exit to end the simulation.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

Installing Linux can be a difficult experience for some


people, and a sail across a calm sea for others. You now
know that the key to a successful installation is in the
preparation. Know what hardware you have installed and
consider how you want to use the operating system, and it
will be a smooth and easy process.
Having completed this module, you should now be able to:
● Describe hardware compatibility issues

● List the steps in creating an installation boot diskette

● Describe Linux installation methods and installation


types
● Describe how partitions are used to improve data
integrity, and explain how the Disk Druid partitioning
tool is used
● List the considerations in planning swap space

● List the steps required in installing a Linux GNOME


Workstation
● Describe how to select the default installation and
system language, keyboard, and mouse configuration
● Describe how to configure the network and select a
time zone
● Describe how to use the Account Configuration screen

● Describe how to prepare for and abort an installation


New terms The following terms may be new to you:
● boot procedure

● bleeding edge hardware


● BIOS
● Disk image
● RAM
● VRAM
● GUI (Graphical User Interface)
● Kernel
● PCMCIA
● dual-boot
● swap space
● motherboard
● chip

● Master Boot Record

Coming up In the next module, we'll discuss getting started with Linux

Exercise
Before moving on to the next module, click the Exercise
button to complete a GNOME Workstation installation.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Preparation for install and the package installation screen


Installing Linux
Objective
Automate your GNOME Workstation install.
This exercise is an unscored opportunity to review what you have learned in this lesson. Complete the
simulation, and answer the two questions below. Click the I'm Done button, to view the Suggested results
page.
Background/overview
You have a system that is prepared for the installation of Red Hat® Linux and wish to proceed with a
Red Hat Linux GNOME Workstation install.
Instructions
You are starting the installation process, and want to learn more about the boot procedures available.
Complete the simulation below so that your GNOME Workstation install is as automated as possible.
Follow the instructions as listed. Once you have completed the simulation, answer the two questions that
follow. Click the OK, I'm Done button to view the results.
Do the following to complete the exercise:
1. Set your time zone to EST
2. Set the root password to sT0[zero]*deNt
3. Create the personal account for pat with the password Aeropl8n3 and the full name Pat Smith
4. Automate all other issues

Submitting your exercise


Answer each of the questions listed. Click the OK, I'm Done button to view the results.
1. Which boot procedure is most commonly used during install?
2. As you know, in order to install Linux, your system needs access to the installation files. If you were
working with a network of Linux machines, which boot procedure would be best to access these files?
Hints
Everything in Linux is case sensitive. Be sure to match the case as it is provided in the exercise.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Getting started with Red Hat® Linux
Module introduction
Linux is a robust operating system (OS) that runs on
IBM-compatible personal computers. Businesses,
individuals, and educational institutions are using Linux in a
variety of applications such as workstations, Web servers,
and file servers. Linux was originated by Linus Torvalds, but
has involved the collaboration of many developers all over
the world who use the Internet to communicate and distribute
changes. The background of Linux lies in the
hacker-programming culture of universities and the Internet,
but is now entering into the realm of the home PC user. This
is due to the growing acceptance of alternatives to Microsoft
operating systems, and the development of user-friendly
interfaces to Linux system administration.
By the end of this module, you will know how to:
● Define the features of Red Hat® Linux

● Define user accounts, group accounts, and superuser


accounts
● Log on to and off of your Linux account

● Describe how to use the GUI interface and open a


terminal window
● Change a password and discuss the importance of
doing so
● Use the man page utility

● Use and customize the GNOME environment

● Create a text file and log off the system

Next lesson The next lesson will define the features of Red Hat Linux.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Module wrap-up
GNOME Workstation installation
Objective
Configure X settings.
Scoring
You will receive 5 points for this exercise. When you have completed the simulation, and answered the
questions that follow, click the OK, I'm Done button to submit your answer to a tutor.
Background
You are in the middle of a GNOME Workstation installation and need to configure the X Window
System.
Instructions
You'll need to figure out a few steps on your own. We'll tell you what to do, but figuring out how to do it
will be your task in this exercise. Complete the simulation below, then answer the two questions that
follow.
If you get stuck, feel free to email the course tutors by clicking the Tutor button in the toolbar.
Hints
Observe how the values change as you move through each step of the configuration process.
Submitting your exercise
Answer each of the questions listed, then Click the OK, I'm Done button to view the results.
1. Which device, if it is not properly configured, could be permanently damaged?
2. Which video-related setting(s) can have multiple associated values?
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Red Hat® and the Linux operating
system
Define the features of Red Hat® Linux.

The Linux
operating
Linux is a UNIX-like operating system that incorporates the
system best features of its commercially available counterparts with
an added benefit to its users: it is free. The core component
of the Linux operating system is the kernel, which controls
hardware devices, system processes, and user access. All
other programs and utilities are separate pieces. Linux is a
multitasking environment, which means it can do more than
one thing at the same time; it's also a multi-user system,
allowing access from more than one user. All applications
and utilities running on the system are referred to as
processes. Linux uses a hierarchical file system structure that
can be thought of as a tree.

What is Red Although the Linux operating system is free, it is also


Hat Linux? distributed by Red Hat at a price (a very reasonable one).
Red Hat's distribution includes installation and configuration
software, the latest version of the Linux kernel, and common
utilities and applications. You may wonder why people
would pay for Red Hat's version of Linux when Linux can be
obtained for free. In any operating system, there are
important processes to be learned and problems to be solved
as you learn to use it, and it may be difficult to solve these
problems without easy access to support systems. Free
software does not usually come with instruction manuals like
software purchased in stores. Red Hat has become a popular
way of distributing Linux because it has made valuable
additions to the base Linux components, and also because of
the excellent technical support it provides to users. In
addition, because there is such a large base of Red Hat Linux
systems around the world, Red Hat acts as a standardizing
force in the diverse Linux community.

Discussion
At this point, please consider going to the Discussion area to
post your background, your current role, and your goals and
expectations for this course. We all have our reasons for
choosing Linux, and we would like to hear what prompted
you to make this decision.

Next lesson In the next lesson, you will learn about user accounts, group
accounts, and superuser accounts.

Quiz
Before moving on to the next lesson, click the Quiz button to
test your understanding of the history of Red Hat and Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Getting started with Red Hat® Linux
Other options for running Linux

Although Linux is most commonly run on IBM compatible


machines, it can also be used on Apple machines (including
the latest G4's) both in server and workstation/dual boot
capacities.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Users, groups, and superusers
Define user accounts, group accounts, and
superuser accounts.

More than one person can access the same Linux system
concurrently. All users have their own account on the
system, which the system administrator creates for them.
Users are categorized into three levels of accounts.

Levels of The highest level user is the superuser account, also known
users as the root account. The root account is used for system
administration tasks such as installing system utilities, or
even creating new user accounts. Because this account is so
powerful, there are security issues associated with its use. It
is recommended that users only log in as root users when
absolutely necessary for making system modifications, and
use their normal Linux user accounts for all other tasks.
All user accounts have a user ID number (UID) associated
with it that is unique. The first account added to a Red Hat®
Linux system will have UID 500. Users are also assigned a
primary group ID number (GID), which matches the UID.
Groups are provided for the purpose of collecting multiple
user accounts into functional units. For example, a database
group could contain all database administrators on a
particular system.
A user account and its password positively identify a user to
the system. This, combined with the UID and GID, provides
an effective level of security within the Linux system. The
ability to grant or deny permission based on a user or group
level is one of the most useful features of UNIX-like
operating systems.

Users, groups, and superusers are further defined in the


following FlipBook.
Transcript

Next lesson In the next lesson, you will learn how to log on to and off of
your Linux account.

Exercise
Before moving to the next lesson, click the Exercise button
to review the definitions of user accounts, group accounts,
and superuser accounts.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Red Hat and the Linux operating system
The connection between Linux and
UNIX operating systems
There are many different "flavors" of the UNIX operating
system, all descended from the original Bell Labs operating
system of the 1960s. The UNIX family tree split in the
1980s, and the two resulting branches became BSD and
SVR4. Linux is similar to each of these flavors of UNIX, and
has continued to evolve into an even more robust system.
The Linux kernel and many other components adhere to the
GNU General Public License (GPL), which dictates that it
can be both sold or given away, but must always be
accompanied by the source code and the GPL.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Red Hat® Linux and the history of Linux


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which component of Linux controls hardware devices, system processes, and
user access?
Please select the best answer.
A. The kernel
B. The X Window System
C. The command line interface
D. The GNU General Public License

2. Who began development of the Linux kernel and continues to maintain it?
Please select the best answer.
A. Richard Stallman
B. Bill Gates
C. Linus Torvalds
D. Red Hat

3. What is a Linux process?


Please select the best answer.
A. The design of the hierarchical file system
B. A running application or utility
C. The method used to start the Linux system
D. One of the many users that can access the system
4. The license that governs the free use of Linux is called what?
Please select the best answer.
A. The Artistic License
B. Bell Labs' UNIX license
C. The X Window System license
D. The GNU General Public License

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Logging on to a Linux account
Log on to and off of your Linux account.

Logging on to
a Linux
So now we've installed our system and understand how user
account accounts are created and used. It's time we log on to our
Linux system for the first time. To begin, Linux presents you
with a login: prompt, which you will respond to using
your username (for practice, we'll say your username is
redhat). At this point, the system will request a password for
the user redhat, so you'll enter the supplied password (also
redhat). After checking to see whether this is correct, the
system will allow you access. It will then start up a shell
process (you'll learn more about this in a moment), which
places you in your home directory.

Case It is important to note that the user name "redhat" contains


sensitivity all lowercase letters. Linux is a case-sensitive operating
system, which means that the system is sensitive to whether
you use uppercase or lowercase letters--a capital "R" is
recognized as being a completely different character than a
lowercase "r," for instance. This is important to remember.
The sample username that we are using has no uppercase
letters. If you mistakenly type any uppercase letters, the
username will not be recognized and you will not gain
access!

The same is true for passwords. This can be very confusing


for users who are not used to a case-sensitive system; they
are certain that they have entered their username or password
correctly because they've typed the right word. They forget
that uppercase/lowercase usage makes a difference, so they
are frustrated when the system doesn't let them in.
The shell In Red Hat® Linux, the first thing you'll see when you boot
up is a command interpreter--the place where you will type
your commands so that the system can read them. This
command interpreter is called a shell, and it will be identified
by a dollar sign character ($). Here is what the login screen
will look like:

Next lesson In the next lesson, you will learn how to use the GUI
interface and open a terminal window.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Users, groups, and superusers
Users, Groups, and Superusers
(FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Users, groups, and superusers


Users, groups, and superusers
Objective
Define the types of user accounts in the Linux system.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five terms; their corresponding definitions are listed in the right column.
Click once on a term in the left column, then click once on the definition in the right column to make a
match.
When you think you have all of the terms and their definitions matched correctly, click the Done button
and you'll see whether or not you've matched the terms correctly--green lines mean the match is correct,
red lines mean the match is incorrect. If you didn't get the matches right the first time, click Clear to erase
your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Working with the GUI interface and
opening a terminal window
Describe how to use the GUI interface and open a
terminal window.

The GUI
interface
A graphical user interface (or GUI) called the X Window
System is distributed with Red Hat® Linux. Although you
can use Linux without it (in a non-graphical environment),
many users find it more comfortable to work in an X
Window environment, where buttons and programs are used
as opposed to typing out long commands on the command
line. The X Window System is also known as X11 and this is
often followed by whatever the current version is. For
instance, if it were version 6, you would see this abbreviated
as X11R6.

A window manager is something that is used to control the


look and feel of the GUI, and can be changed to suit each
user's preference.

Working with a A window is simply an interface that is used to access


window applications on your system. Windows can be moved,
resized, iconified (minimized) and closed; all of these
operations are handled by the window manager.
One kind of window is also called a pseudo terminal because
it emulates the Linux console mode, and supplies a shell for
the user. GNOME terminal windows can be started from the
panel, but there are many other terminals available. The most
popular is the xterm, a basic terminal that has the ability to
be heavily customized for individual users. Color can be
added, the default size changed, and programs can be
executed when the xterm is initialized.
The following applet illustrates window operations.
Transcript

Next lesson In the next lesson, you will learn how and why to change
your password.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Changing your password
Change a password and discuss the importance of
doing so.

The password for your user account is the most basic but
important form of security. The easiest way for unauthorized
access to occur is from compromised user passwords. To
prevent this, there are guidelines for selecting powerful
passwords. Protecting yourself does not stop at password
selection, however. You should change your password on a
regular basis. A common schedule for password changes is
every six months, but more frequent password changes are
acceptable.
Passwords should be changed after the first login by
following these steps:
● From a terminal, enter the command: passwd

● You will be prompted for the New UNIX password.

● From the GNOME panel, select: System menus/


System/ Change password
● An input window will come up requesting your new
UNIX password.
● You will then be asked to retype your password. If you
make any errors and it doesn't match your new
password, the change will not take affect. If it is
successful, use this new password the next time you
log in.
To select a good password, it is important to adhere to the
following guidelines:
● Avoid passwords that are easy to guess

● Use numeric as well as alphabetic characters

● Avoid using dictionary words, or combinations thereof


(real words are easier to guess than combinations of
letters and symbols)
● Nonsense words can be useful

Next lesson In the next lesson, you will learn how to get online help with
the man page utility.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a lab on how to log on to the system.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Working with the GUI interface and opening a terminal
window
Window manager choices
Common window managers are Sawfish, Afterstep and
FVWM2, all of which are included in Red Hat®
distributions. The GNOME desktop environment is a popular
addition to the window manager that allows further
customization of the GUI and specialization of the look and
feel. By default, you will see the GNOME panel at the
bottom of your screen, as well as the GNOME Help Browser
when you start X Windows.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Working with the GUI interface and opening a terminal
window
Options for closing a window
The best way to close a window is by exiting from within the
specific application. There are occasions, however, when the
application may be in an unstable state and unresponsive to
user input. At these times, you can override the application
by using the Close button that the window manager provides.
A third option is to annihilate the window, which kills the
application and the window immediately, but this should be
reserved for extreme circumstances when all else fails.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Working with the GUI interface and opening a terminal window
Working with a window (MouseOver
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Getting online help with the man page
utility
Use the man page utility.

The man page


utility
The help facility in Linux is called the man page, which is
an online manual of all user commands. Quite often users
realize that while they know some portion of the command
they want to use, the can't remember every option. Man
provides a fast method of verifying that the command you
are attempting to use is formatted correctly. All of the entries
on the man page are formatted in a consistent manner, with
the name and synopsis at the very top of the page followed
by the description of the command and options.
In order to access the man page, you must type the following
in the command line:

man page_name

The man page sections are groupings of commands,


organized into categories by type. These sections can be used
to speed up your search for the manual page, if you know
what section it is in. For example, the pwd command is a
user command, so the command
man 1 pwd would quickly display the manual page
requested. The section number is not required.

The following table summarizes the different sections that


are used to categorize man entries.
Section Contents

1 User commands

2 System calls

3 Subroutines

4 Devices

5 File formats

6 Games

7 Miscellaneous

8 System administration

n New

Next lesson In the next lesson, you will learn about the GNOME desktop
environment.

Exercise
Before moving to the next lesson, click the Exercise button
to practice getting online help.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Changing your password


Lab: system logon
Objective
Perform the steps necessary for logging on to the system.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Instructions

Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted
with a password: prompt. Enter your password here. You should now see the shell prompt like this:

[root@localhost /root]#

Step 2: Type passwd to change your password. You will receive the following prompt:

New UNIX password:

Step 3: Here you should enter a new password of eight characters or more, containing at least one
uppercase character and one numeric character. For example, "Temp1234" would satisfy these
requirements. You'll then see this prompt:

Retype new UNIX password:


Step 4: Enter the same password you did in the last step, or you'll see an error about the passwords not
matching. If you were successful, you should use this password the next time you log into the lab.

If you have problems or questions about this lab, please contact a tutor with your concerns.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The GNOME desktop environment
Use and customize the GNOME environment.

The GNOME
help browser
The GNOME help browser is an interface which allows you
to easily access man, info and the GNOME User's Guide.
The GNOME User's Guide documents are specific to
operations you may need to do when using the GNOME
desktop environment. You may also view GNOME
documentation pages that are separate from the User's Guide.
The GNOME User's Guide is launched from the panel, but is
also started by default when you install the Red Hat® Linux
system. The interface is quite intuitive to use, but there are a
few commands that don't appear in the man and info sections
that you might like to see, since they exist in the online
manual. In these cases you should be able to get what you
need by using the man and info commands in a terminal
window.

Customizing The GNOME panel is the operations center of the GNOME


the GNOME desktop environment. It contains the Main Menu, popular
panel applications and utilities, and any of your personal favorite
applications which you choose to add.
GNOME has simplified many of the configuration
procedures in the X Window System. In the past, you had to
edit files to customize your panel; now you only have to
access the GNOME Main Menu to add applications to the
panel. You can also hide the panel to give yourself more
usable space on your desktop. To do this, you can click on
one of the two buttons on the extreme right or left side of the
panel with the arrow icon. If the standard panel is too small
to contain all of your personal favorites, you can add more
panels to the desktop. Again, you can use the Panel
sub-menu to do this.

The following table will walk you through the process of


customizing the GNOME Panel. Click on the thumbnails to
see full-sized images of the GUI.
This is the default GNOME desktop at startup.

Click on the main menu (footprint) icon and this is


what you will see.

Within the Main Menu, click on the Panel sub-menu.

Select Add new launcher.

The Create launcher applet window appears.

Here you type in the name of the new application


(gedit) and the command you wish to run
(/usr/bin/gedit). The icon you want is already
shown (the gedit icon). Now you can click on OK.

The window disappears and you can see that the


application has now been added to your menu panel.
It is second from the left, next to the GNOME icon
(footprint).

By going through the Main Menu just as we did


before, we select Panel again.
Choose Convert to corner panel to shrink the panel to
its smallest possible size.

The panel slides into the left corner, removing all


empty space.

Now use what you've learned about GNOME by completing


the following simulation. The simulation will tell you what
to do, but you will have to remember exactly how to do it by
recalling what was covered in the lesson.

Transcript

Next lesson In the next lesson, you will learn how to create a text file and
log off the system.

Quiz
Before moving to the next lesson, click the Quiz button to
review the features of the GNOME desktop environment.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Getting online help with the man page utility


Lab: getting online help
Objective
Follow the necessary steps for getting online help.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Instructions
Enter the course lab to do this exercise.
You are going to examine the man pages for the following commands: man, ls, cd, pwd, and chmod.
You will first view the man pages before outputting them to a file.

Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted
with a password: prompt. Enter your password here. You should now see the shell prompt like this:

username@redhat $

Step 2: Use man to view all five commands listed above: man, ls, cd, pwd, and chmod
Example:

username@redhat $ man ls

This will format the output according to the size of your telnet window. You should see the command
listed at the top of the page, followed by the name, synopsis, description, and so on. If you don't see this,
send a note to the tutor.

Step 3: Now you will output the commands you ran in Step 2 to a text file for grading. At the shell
prompt, type the same command, man ls, but we'll follow it with the redirect operator (>) and an
output file name (the redirect operator (>) forces the output of the command to go to the filename
specified, rather than the screen). You should name your files with the command you are looking up,
followed by .out. This example shows the output being redirected to a file called man.out.

username@redhat $ man ls > man.out

If you have problems or questions about this exercise, please contact a tutor with your concerns.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Editing text files and logging off
Create a text file and log off the system.

Editing text gEdit is a full featured, menu driven, easy-to-use text editor.
files using With gEdit you can create new files, edit existing text files,
gEdit and even work with specially formatted text files like email.
The gEdit editor is considered part of the GNOME desktop
environment; you can tell by looking at the first letter of the
application command. All applications developed specially
for the GNOME project effort have the letter G at the
beginning of the name, to identify them as different from any
generic program that may already exist in the X Window
System.
You can launch this application from the panel:
Main Menu (footprint)/Applications/gEdit

Or from the command line:

gedit [filename]

Once the file you are editing is open, you use gEdit with your
mouse by selecting areas or menus. You can type any text,
use common editing actions like cut, copy, and paste, search
the file for a certain text string, or print your file. There are
buttons to complete the actions listed above, but you can also
use the Edit menu, or the common keystroke shortcuts, such
as Control-V for paste.
The following simulation allows you to practice editing a
text file:

Transcript
Logging off Now that you are at the end of your session, you need to log
off properly. If you are working in a non-GUI session, you
need only type the exit command. This will bring you
back to a login prompt if at the Linux console; if you are
using telnet, you'll be disconnected from the host system.
From the X Window System(GNOME), click on the Main
Menu and choose Log Out, or right click on the Panel and
select Log Out.

On your own ● Experiment with the Window options menu


● Try adding and removing different applets to the
GNOME Panel one at a time

● Browse the documents available through the GNOME


Help Browser

Next lesson The next lesson wraps up this module.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice logging off of the Linux system.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The GNOME desktop environment
Using the GNOME desktop (Simulation
transcript)
1. Look up the ls command in the GNOME Help browser
man pages.
2. ls is in the User Commands section of the manual.
3. View the man page for ls.
4. Now go to the Main Menu to add the gEdit
application.
5. From the Main Menu go to the Panel sub-menu.
6. Add a new launcher icon to the Panel.
7. Add gEdit with the path /usr/sbin/gedit. We've already
chosen the icon for you. Select OK when finished.
8. After the gEdit icon has been added, we'll remove the
Netscape icon from the Panel. This is done by clicking
on the Netscape icon with the right mouse button.
9. Select the appropriate action in the applet menu to
remove the Netscape applet.

10. This completes the Simulation. Click the Exit button.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

The GNOME desktop environment


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.

1. What are the four informational sections you can view directly from the
GNOME Help Browser window?
Please select all the correct answers.
A. The GNOME User's Guide
B. The GNU General Public License
C. GNOME documentation pages
D. UNIX history
E. Man pages
F. Info pages

2. The Main Menu (footprint) resides in which GNOME component?


Please select the best answer.
A. The GNOME Help Browser
B. The Applications submenu
C. The Man pages
D. The GNOME Panel

3. There are two buttons that allow you to hide the GNOME Panel. Where are
they located?
Please select the best answer.
A. In the GNOME Help Browser
B. In the Applications submenu
C. At the extreme left and right sides of the GNOME Panel itself
D. In the Main Menu

4. When you convert the Panel to a corner Panel, what are you primarily doing?
Please select the best answer.
A. Removing the Netscape icon
B. Shrinking the Panel to it smallest size while still allowing all
icons to be viewable
C. Hiding the Panel
D. Adding an extra Panel for our extra applets which do not fit on
the standard Panel

5. How does GNOME simplify the configuration of the X Window environment?


Please select the best answer.
A. By providing the GNOME Help browser
B. By allowing you to use Main Menu actions rather than manually
editing text files
C. By giving you the convert Panel option
D. By providing gEdit

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

As you have seen, Red Hat® Linux has many varied


features that comprise a strong operating system. You have
now worked with user accounts, the command line interface,
the X Window System, and have seen how Linux is different
from other UNIX platforms.
By now, you should be able to:
● Define the features of Red Hat Linux

● Define user accounts, group accounts, and superuser


accounts
● Log on to and off of your Linux account

● Describe how to use the GUI interface and open a


terminal window
● Change a password and discuss the importance of
doing so
● Use the man page utility

● Use and customize the GNOME environment

● Create a text file and log off the system

New terms Here is a list of terms used in this module that may have been
new to you:
● Kernel

● Shell
● source code
● GUI
● Nongraphical Text-based interface
● Info
● Main Menu

● Text editor
Coming up In the next module, you'll learn about the Linux filesystem.

Quiz
Before moving on to the next module, click the Quiz button
to review some of the activities you have learned in this
introductory module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Editing text files and logging off
Editing text files (Simulation transcript)
1. First we launch gEdit from the command line by
typing in the full path to gEdit, which is:
/usr/bin/gedit.
2. The above screen will appear. Enter the text "The
quick brown fox jumped over the lazy dog." into the
gEdit window.
3. Click the "Save" button above the text area.
4. Since this is a new file that has never been saved
before, the system wants to know what to save it as.
The Save As window opens up for you. Type the
filename: file1.txt into the empty field at the bottom of
the window. Then click OK.
5. We now see our sentence again. To cut and paste
within our document, we must first decide what we
wish to cut, such as the words "jumped over." We
would need to highlight these words with our cursor
(we have done this for you) then click on the Edit
button above to get the Edit menu.
6. Select Cut from this menu.
7. We can see that the phrase we selected has been cut
from the sentence. Now we must decide where we
want to paste the cut phrase. Put your cursor two lines
beneath the word "the" and click on the Edit button to
get the Edit menu again.
8. Now from the Edit menu select Paste.

9. The result will be as shown: the phrase you cut now


appears two lines below the original sentence. This
completes the Simulation. Click the Exit button.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Editing text files and logging off


Lab: logging off
Objective
Practice logging off of the Linux system.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Instructions
In this lab, you are going to run three commands to examine your environment and then log off the lab
system.

Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted
with a password: prompt. Enter your password here. You should now see the shell prompt which
looks something like this:

username@redhat $

Step 2: Type the who command. You will see all the other users on the Linux system at the same time
you are. Here you can see the advantage of the Linux multi-user environment; it allows many people to
access the system at the same time while not affecting each other.
Step 3: Now type the whoami command. This is a command to show what user ID you have used to log
in. This command is useful if you log in using more than one user ID, and forget what screen you are
working with.
Step 4: Now enter the date command. It may be somewhat obvious what this command does, but this
command probably gives you more information than you expected.
Step 5: You are going to log out. Simply type exit at your shell prompt, and you will be disconnected
from the lab system.

If you have problems or questions about this lab, please contact a tutor with your concerns.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Understanding the Linux Filesystem
Module introduction
If you're using a computer, you're interacting with the
filesystem in some way. A filesystem describes how your
hard drive is set up to manage and access the data on your
operating system.
The Linux filesystem is somewhat different from other
operating systems you may have worked with. If you were
using the Microsoft operating system before Windows 95,
you're already familiar with the MS-DOS filesystem.

As a Linux user, you must become familiar with the Linux


filesystem and how to work with it. This filesystem is
referred to as ext2, and is different from non-UNIX
filesystems in many ways.
When you have completed this module, you will be able to
do the following:
● Describe the Linux filesystem hierarchy

● Describe the Linux directory system

● Describe the purpose of the various user directories


and the home directory
● Explain the role of the GNOME file manager

● Describe the features and functionality of the GNU


Midnight Commander
● Use GMC to sort files

● Navigate the Linux filesystem using relative and


absolute paths
● Demonstrate the use of the ls and pwd commands

● List the different file types and determine the file type
from the command line
● Identify file type in GMC

● Create files and directories on the command line


Next lesson We'll start by exploring the layout of the Linux filesystem.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Reviewing the introduction to Linux


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. What component controls the hardware and initiates running programs in the
Linux system?
Please select the best answer.
A. The kernel
B. The GNOME desktop environment
C. The man pages
D. The command line interface

2. GNOME stands for


Please select the best answer.
A. Great Network Oriented Machine Engineering
B. GNU Nascent Optional Machine Environment
C. GNU Network Oriented huMan interfacE
D. GNU Network Object Model Environment

3. A good password has what features?


Please select the best answer.
A. Six characters minimum, at least two uppercase characters
B. No more than one numeric character
C. Eight characters minimum, at least one uppercase letter and one
numeric character
D. Ten characters minimum
4. What does the man command do?
Please select the best answer.
A. Allows editing of text files
B. Searches for a manual page entry and prints it to the screen
C. Lists the contents of the current working directory
D. Starts the X Window System

5. The GNOME Help Browser acts like what category of application?


Please select the best answer.
A. A text editor
B. A Web browser
C. The command line interface
D. A file manager

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introducing the Linux filesystem
Describe the filesystem hierarchy.

The Linux filesystem is laid out in a series of top-level


directories; each directory contains a specific segment of
Linux functionality or answers a specific storage need. The
top level is called the root directory and is simply
represented by a /; typically, there is nothing stored directly
in the root directory.
Use the MouseOver below to explore the major directories
you will find in the Linux filesystem hierarchy, and the
important elements they contain.
Transcript

The usr The usr directory is the base point for another hierarchy that
directory contains items that can be shared among multiple Linux
machines. Each of the directories in the usr directory is
explained in more detail in the table below.

Directory Description

Contains the files and programs used to run the X Window


X11R6
System

Contains the programs that users often need but are not
bin
necessary for the system to function

dict Contains various dictionaries used by different programs

Contains documentation that comes with the installed


doc
packages

Contains configuration files that are not used by critical


etc
system applications

Contains the C programming language, including files the


include
system requires

lib Contains the libraries required by specific programs


Contains software that you can avoid having to reinstall if
local
you otherwise reinstall Linux

man Contains the manual pages for all of your programs

Contains binary (executable) files that are used by the


sbin system administrator, but not usually by the user; the system
cannot function without these binary files

src Contains source code for system programs

Comparing One important concept to understand about the Linux


directories and filesystem hierarchy is that you may not automatically notice
partitions a difference between directories and partitions. This issue is
transparent to Linux. Also, you'll notice that when you look
at file listings, anything with a capital letter will be listed
ahead of lower case letters. Keep this in mind when you
explore the filesystem on your own later.

Join the In what ways is the Linux filesystem structure different from
discussion on other filesystems you might be familiar with?
the Linux
filesystem
Discussion
Click the Discuss button on the toolbar to discuss this, or
related, topics.

Next lesson In the next lesson, you will learn about the structure of the
Linux directory system.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete an exercise on the Linux filesystem.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Understanding the Linux Filesystem
Today's Windows filesystem
Today, Windows uses either VFAT or VFAT32, the most
obvious difference at the user level being that you are no
longer limited to short file names with eight characters,
followed by a dot, and then three characters.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Typical Linux directory structure and
Linux system directories
Describe the Linux directory system.

Files and
directories
Linux sees everything as a file. This fact can get really
confusing as you get into more advanced topics. The most
important things to remember are:
● Every file in Linux is stored on the system with a
unique name. This name consists of both the file name
itself, and the entire series of directories leading to that
file.
● All files are stored in directories that can also hold
other files or directories.

● The entire collection of files you work with in Linux is


called the Linux filesystem. This includes partitions,
devices you temporarily have mounted, printers, and
more, as you will learn throughout this and later
courses.

The directory Directories in Linux are a special type of file that can contain
structure other files. Their function is similar to folders in a file
cabinet. They are used to organize and group related files
together in Linux, just as they are in other operating systems
such as MS-DOS, Windows, and MacOS.
As we saw in an earlier lesson, the complete filesystem has a
tree-like structure in which directories "branch off." You
represent a branch in this tree with a series of slashes
between each of the directories.
For example, if you have the file mytext in your redhat
home directory, then the path through the tree to the file is
/home/redhat/mytext. Why? The reasons are as
follows:
1. Everything starts in the root directory, or /
2. All user home directories are in the directory home
3. Your redhat home directory is in a directory named
redhat inside the directory home

You can have other files named mytext only if they are not
inside /home/redhat.

Next lesson In the next lesson, you'll learn about the /home branch of
your directory tree.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introducing the Linux filesystem
Linux filesystem hierarchy (Mouseover
transcript)
/

bin
boot
dev

etc
home
lib

mnt
opt
proc

root
sbin
tmp

usr
var
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Introducing the Linux filesystem


The Linux filesystem
Objective
Demonstrate your understanding of the Linux filesystem layout.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five top level directories; functions associated with each are listed in the
right column. Click once on a term in the left column, then click once on the definition in the right
column to make a match.
When you think you have all of the terms and their definitions matched correctly, click the Done button
and you'll see whether or not you've matched the terms correctly--green lines mean the match is correct,
red lines mean the match is incorrect. If you didn't get the matches right the first time, click Clear to erase
your matches and try again.
Hints
Often the directory name itself contains a clue about its contents.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
User directories and the home directory
Describe the purpose of the various user
directories and the home directory.

The system is not the only entity that needs to have private
space for its files. It is important that there is space set aside
for users also. Not only do users need somewhere private to
store their files, they also affect the filesystem in other ways
through programs creating temporary files, and more. By
separating user data and programs into their own trees in the
filesystem, you avoid mixing user and system files together.

User User directories are used for a number of purposes. Many of


directories these directories are contained within the /home branch of
the filesystem tree. Having a series of individual user
directories within the home directory enables Linux users to
each have their own filesystem space within the directory
tree. They can place anything they want in their home within
limits set by the system administrator. Many Linux users in
fact only ever work with their own user directory, which is
also called the user home directory.

Another user directory in Linux is the /tmp directory.


Temporary files created by programs run by users are stored
here until they are removed. In fact, users can directly write
to the /tmp directory if they want to place a file in there for
some reason, and can view its contents.

Next lesson In the next lesson, you will learn how to manipulate
directories and files.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The GNOME file manager
Explain the role of the GNOME file manager.

A file manager is a tool that simplifies navigating and


manipulating your filesystem's contents. Many people prefer
using a graphical file manager. Windows Explorer is an
example of a graphical filesystem manager that allows
navigation of the hard drive and other media's contents. The
same easy navigation is available in Linux in the GNOME
(graphical interface for Linux) desktop environment. The
default file manager is known as the GNU Midnight
Commander, or the GMC.

Launching To start the GNU Midnight Commander:


GNU Midnight 1. Click on the Main Menu button on the GNOME Panel
Commander
2. Select File Manager to launch the GNU Midnight
Commander

Your current (working) directory is listed in the location bar. In the


FlipBook example below, the current working directory is
/home/redhat.

Click the FlipBook button to the left and see these steps in
Transcript
more detail.
Choosing file GNU Midnight Commander offers four different ways that
view details you can view files and directories in a listing. They are Icons,
Brief, Detailed and Custom. These options are available by
clicking one of the four buttons in the top right portion of the
GMC window. Click the Image button to the left to view
these options.

The following table demonstrates the differences between the


different view types. Click on each of the thumbnails to see
each view.

View Result

Icons

Brief

Detailed

Custom

As you'll see later in this module, using the cd command is


equivalent to clicking on a directory in GMC.
Next lesson The next lesson discusses how to use the GNU Midnight
Commander.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using GNU Midnight Commander
Describe the features and functionality of the GNU
Midnight Commander.

Because the GNU Midnight Commander is a


point-and-click tool, working with it is simple. Use the
MouseOver below to explore the features available to you
with GMC in the Icon view.
Transcript

Next lesson The next lesson discusses how to use the GNU Midnight
Commander to sort files.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The GNOME file manager
Opening GMC (FlipBook transcript)
Click the following thumbnails to view the full-sized image.

Click the footprint icon to open the GNOME Main


Menu.

Click the File Manager in the GNOME Main Menu


to open the GNU Midnight Commander.

GNU Midnight Commander opens by default into


your home directory.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using GMC to sort files
Use GMC to sort files.

If you choose the Brief, Detailed, or Custom view in the


GMC, you'll see several bars at the top of the file listing. The
image below shows the Custom view.

Each of the bars at the top of this pane is "clickable," and


each allows you to sort the data from ascending to
descending order or vice versa. Clicking a second time
reverses the sort. Step through the following simulation for a
demonstration of how this works.

Transcript

Next lesson In the next lesson, you'll learn about the Linux directory
system.
Exercise
Before moving on to the next lesson, click the Exercise
button to complete an On Your Own exercise.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using GNU Midnight Commander
A tour of GNU Midnight Commander
features (MouseOver transcript)
1.

2.
3.
4.
5.
6.
7.
8.
9.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Moving through the filesystem
Navigate the Linux filesystem using relative and
absolute paths.

Navigate the
Linux
Navigating the Linux filesystem is an important skill to
filesystem learn. You may already know how to do this graphically, but
you will not always have this option; in fact, you may find
that you prefer to work directly at the command line when
you do not need a specific GUI feature.
There are a few important points to note when working with
Linux:
1. Linux is case-sensitive. For example, the filename
Linus_Torvalds is not the same as linus_torvalds.

2. Space matters: As you'll soon see, in Linux, spaces are


often used to delimit elements on the command line.
For example, cat file1file2 is not the same as
cat file1 file2.

Changing One of the most common navigation commands you'll use is


directories on the cd command.
the command
line: cd The syntax is as follows: cd [pathname from root]
The cd command is generally used at the command line
either outside of GNOME or in a GNOME terminal window
to switch from one directory to another. It is the key to
navigating the Linux filesystem.

To move to the root directory, type:

cd /

To move to /etc/X11/xinit, type:


cd /etc/X11/xinit

Ordinary users will be prevented from changing to some


directories on the system. The owners of these directories,
such as the /root directory, have blocked access to these
directories. Changing the permissions on your directories
will be covered later in this course.

Moving to the As you will remember from the earlier discussion on the
parent filesystem hierarchy, the parent directory refers to the
directory on directory immediately "above" the one in question. When
the command you move to the parent directory, you are essentially moving
line up one level in the directory tree.

To move to the parent directory, use two dots such as:

cd ..

Multiple dot pairs can be used to move up several levels at a


time, such as in the following example:

cd ../../..

This moves you from the current directory to the parent of


the parent of the parent directory. For example, if you typed
it from within /home/redhat/documents, you would
end up in the root directory.

As mentioned earlier in the lesson, space is important. A


space must be entered between the cd and the two dots (..).
Also, the dot (.) represents the current directory on the
command line. For example, the command:
cd .

Typing cd . takes you back to the current level. In other


words, you will end up in the directory where you started.
You are already in . because it represents the current
directory. Many people find this confusing in the beginning.
Its purpose will make more sense when you learn more
filesystem commands.

Relative and There are two ways to move from one directory to another on
absolute paths the command line. One way is to use a relative path, and the
on the other is to use the absolute path.
command line
Think of relative and absolute paths as being two ways to
reach the same destination. The relative path will be relative
to where you are coming from. The absolute path will be the
global starting point for anyone, regardless of where they are
coming from.
Let's look at how absolute and relative paths pertain to
filesystem navigation. As we mentioned above, there are two
ways to move from one directory to another on the command
line. In both of the following examples, you are already in
the /home directory. Both examples take you to the same
end place.
1. Use the full (absolute) path that lists the complete path
to the directory you want to go to from the root
directory:
cd /home/redhat
2. Use a relative pathname (that refers to only the parts of
the path you want to go to compared to where you are
now), such as typing from inside /home:
cd redhat

This also takes you to /home/redhat.

You can return to your home directory from anywhere by typing


cd ~. The ~ is known as the tilde.
Relative and You can also use relative and absolute paths using the GMC.
absolute paths The FlipBook below describes how absolute paths are used,
using the GMC first on the command line, then using GMC.

Transcript

Next lesson The ls and pwd commands are two of the most useful in
Linux. These commands are discussed in the next lesson.

Exercise
Before moving to the next lesson, click the Exercise button
to complete a lab on how to change directories on the
command line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using GMC to sort files
Use GMC to display and sort files
(Simulation transcript)
1. Click the Detailed button to change to Detailed view.
2. Click the Name header bar to sort by file name from
lowest to highest.
3. Click on the Size header bar to sort by file size from
largest to smallest.
4. Click on Size again to reverse the sort.

5. Files are now sorted from smallest to largest. This


completes the simulation. Click Exit.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Using GMC to sort files


Use GMC to display and sort the contents of your home directory
Objective
Use GMC to display and sort the contents of your home directory.
This is an On Your Own exercise. When you have completed the exercise, click OK, I'm Done to
continue.
Background/overview
This is an opportunity to work on a live filesystem on your own machine. To begin the exercise, you
should be in the GNOME desktop environment with no other applications open. If you are at the
command line, then type startx to enter the GUI. Then click File then Close for any programs that
start automatically.
Scoring
This On Your Own exercise provides you an unscored opportunity to practice what you learned in the
previous lesson. You will be able to complete this exercise on any Linux system running X Windows.
You will be presented with a task, but you will not submit your response to a tutor. When you have
completed the exercise, click the OK, I'm Done to continue.
Instructions
You will need to complete this exercise on your own system.
I. Start by opening the GNU Midnight Commander:
1. Click the footprint icon to open the GNOME Main Menu.
2. Click the File Manager menu option to open the GNU Midnight Commander.
II. View the contents of your home directory including file sizes:
1. Click the Home button to display the contents of your home directory.
2. Click the Detailed button to see file information including the file size.
III. Sort the files in your home directory by size from smallest to largest:
1. Click the Size bar on the top of the file listing. No directories will move in the sort.
2. If the files are sorted from largest to smallest, click the Size bar again to reverse the sort.
Guidelines
Remember that if you click a wrong button somewhere, you are not trapped. You can always start over
by clicking the Home button to return to your home directory.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Investigating the Red Hat® Linux
filesystem using ls and pwd
Demonstrate the use of the ls and pwd commands.

Being able to move through the filesystem is useful, but


there are many other useful commands in Linux that will
allow you to view files in different ways. The default Red
Hat Linux prompt shows you the narrowest level of the
directory you are in. For example, if you are in
/home/redhat as the redhat user, your prompt will look
like [redhat@localhost redhat]. In this lesson, you
will learn how to view the files in your directories, and to get
your bearings in the filesystem at any given time.

Using the pwd It is often useful to be able to find out where you are in the
command system. One way to do this is to use the pwd or print
working directory command.
The pwd command prints the pathname of the current or
working directory.

The syntax is as follows: pwd

Listing files You can use ls with various options. For example, to print a
using ls list of files for the /etc directory, simply use ls /etc
without options.
The syntax is as follows: ls
To print a long listing for files for the working directory, use
the -l option.
The syntax is as follows: ls -l

There are several useful ls options, some of which are


described in the table below.
Flag Description

-a Include files and directories whose names start with a period

-d Only list the . and .. directory entries

-h Print file sizes in human-readable format rather than just in bytes

-l Print out the long listing format, which includes permissions,


ownerships, last modification times and sizes

-r Reverse order while sorting

-R Include subdirectory contents

-S List files in order of size

A long listing A simple listing (ls) simply contains file and directory
names, none of which begin with a period. A long format
listing (ls -l) contains file/directory names and other
information such as when the file was last changed, its size,
its permissions and ownerships. Once again, filenames that
begin with a period are excluded.

These options can be combined. For example ls -lr


combines the -l and -r options. Experiment with different
options on your own. Notice the different Linux file types
that are listed. We will discuss these in more detail later in
the course.

Listing files As shown in the View Image to your left, the Contents
using GMC window of GMC shows the files in the currently selected
directory. To see the contents of another directory, select it in
the left-hand side tree view. Contents for that directory will
be displayed in the right-hand side contents view.

If you are working in GMC, the current directory is shown in the


Location bar.
Next lesson The next lesson explains what types of files you will
encounter in Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Moving through the filesystem
Changing directories (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Moving through the filesystem


Lab: change directories on the command line
Objective
Change directories using relative and absolute paths on the command line.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to get more familiar with using the cd command to move through the filesystem.
Instructions
Log into the lab, which starts you in your home directory (structured as shown below):

You are currently in the /home directory. Using the directory diagram, do the following:
1. You need to access something in the files directory. Go to the redhat directory using the
absolute method.
2. You are now in the redhat directory. Go to the files directory using the relative method.
3. You are done with the file in the files directory. Go to the main home directory using the
relative method.
4. You are now in the home directory. Go to your own home directory (/home/redhat) using the
"my home" shortcut.
5. You are now in the redhat directory. Go to the root directory using the absolute method.

Hints
Not all of these steps have to be completed by just typing one thing. You can use multiple commands if
you need to, but remember to separate multiple commands with a semi-colon.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exploring file types
List the different file types and determine the file
type from the command line.

As was mentioned in an earlier lesson, Linux can tell the


difference between items by assigning each file a type.

Linux file There are a number of different file types. Each is used for a
types different purpose, which you will learn more about as you
continue to learn about the Linux filesystem.
● Ordinary files

● Directories

● Block and character device files

● Symbolic links

● FIFOs (First In, First Out)

Determining You can get file type information at the command line using
the file type the file command. This command uses a series of tests and
from the then displays the type of file. You use this command with the
command line syntax:

file [filename...]
Linux file The output of the ls -l command on the command line
types can be used to determine file types. To use this long line of
data just to get the file type, look at the very first character in
the listing.

Descriptions of the standard Linux file types that appear in


the output of the ls -l command are provided in the table
below.

Type First Character Description

Text - A text file

Directory d A directory

A shortcut to the real version of a


Link l
file

A physical device, typically a


monitor or a keyboard, to which
Character device c Linux sends one character at a
time. Modems are also character
devices.

A physical device to which Linux


Block device b
saves data, grouping it into blocks.

Valid Linux file Every operating system has its own idiosyncrasies to
names consider when naming files. There are a number of common
mistakes to avoid when assigning file names.

When it comes to file names, Linux is a pretty lenient


operating system (OS).
The file naming conventions are as follows:
● The only characters that are illegal in Linux filenames
are the slash and the ASCII null
● File names are limited to 255 characters

● Do not use system reserved words for file names

● File names are case-sensitive


Hidden files Hidden files are files whose names begin with a period.
There are certain considerations to keep in mind when
working with hidden files:
● Hidden files are not visible in GMC unless an option is
set
● Hidden files are not visible with the ls command
unless the -a option is specified

Hidden files are often used for customizing the Linux


environment. If you type ls -a in your home directory, you
will see a number of files used to save preferences you set in
various programs.

Hidden files in To see hidden files while working in GNU commander:


GMC 1. Click the Settings menu
2. Choose Preferences
3. Select the File display tab

4. Select Show hidden files option

Next lesson If you're using the GUI Red Hat® interface, you need to be
able to determine file type in GMC. You'll learn how to do
this in the next lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Determining the file type in GMC
Identify file type in GMC.

Using the GNU Midnight Commander to determine file


type is a snap. Simply change to the Detailed view, and then
look to the file's left. The icon in the leftmost column
explains what type of file each item is. Another quick visual
clue is the color in which the file name appears.

File type in The following table explains some of the more common cues
GMC to look for.

Type Symbol Color

Device driver Pink

Directory Blue

Executable text file Asterisk (*) Black

FIFO (First In, First Out--a pipe file) | Black

Links Green

Socket = Black

Text None Black

For a printable version of the above table, click the Easy


Reference folder icon.
Next lesson In the next lesson, you will learn how to manipulate
directories and files.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exploring file types
Common mistakes when naming files
There are a number of common mistakes new Linux users
make when naming their files. For one thing, try to avoid
putting spaces in a file name. You can actually access the file
later, but you will have to understand the proper techniques
for doing so. Remember that Linux is case-sensitive, so you
will have to type the file name later exactly as you enter it
initially (or change it later).

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File and directory manipulation
Create files and directories on the command line.

Once you're comfortable with navigating the Linux system,


you'll want to create your own files and directories.

Creating a You can create directories on the command line using the
directory mkdir command.
using mkdir
The syntax is as follows:

mkdir [dir]

or

mkdir [path/dir]

An example would be to create a directory test. The syntax


in this case is as follows:

mkdir test
Creating You can also create files on the command line using several
empty files different commands. The touch command is one example.
using touch
The syntax is as follows:

touch [filename]

This creates empty files on the command line. touch also


modifies the recorded times that the file was last read (access
time) or changed (modification time).
For example, if you use the command touch yellow, and
the filename already exists, the access and modification data
are updated in the filesystem. To see the time information for
a file, use:
● ls -lc for modification information

● ls -lu for access information

Often the file was changed the last time it was accessed, so
frequently these two values are identical.

In our example, the file yellow already exists and is listed in


ls -l yellow as follows:

-rw-r--r-- 1 root root 137 May 23


14:23 yellow

You now issue the command touch yellow.

ls -l yellow
If you were to now do a long listing for the file yellow, the
output for the current date and time would be as follows:

-rw-r--r-- 1 root root 137 July 4


05:55 yellow

The commands ls -lc and ls -lu would give you an


identical response to the one above.

What happens when you use a command that creates an


empty file (for example, the touch command), and you use
the name of an existing file? Try it and see.

Don't try this with an important data file!

Removing Just as you can create directories, you can delete them.
directories
using rmdir The syntax is as follows:

rmdir [dirname]

To accommodate the new user, the rmdir command


removes only empty directories, and will give an error
message should you try to remove a directory without first
deleting its contents. An example would be to remove a
directory test.

The syntax here would read as follows:

rmdir test
To delete a directory without first removing the contents, use
rm with the -r option.

Be careful when removing directories! If you use rm with the -r


option, Linux will do exactly as you ask it to--even when this is
not intentional. This would include permanently removing
directories that contain information, without asking for
confirmation.

Removing files The rm command removes files. The syntax is as follows:


and directories
using rm
rm [options] [file...]

Note that directories can be removed with this command as


well with the -r option.

Creating a new To create a new directory with the GNU Midnight


directory in Commander, do the following:
GMC 1. Click the directory where you want to place the new
directory
2. Select New from the File menu
3. Select Directory

4. Enter the name that you want to give to the new


directory

Deleting files Directories and files can be deleted in the GNU Midnight
in GMC Commander by doing the following:
1. Select the file or directory you want to delete in the
right-hand window pane

2. Select Delete from the File menu.


The X file As you will have guessed, it is possible to use all of these
manager commands in the GUI environment. If you are not entirely
happy with the GNU Midnight Commander, there is another
graphical file manager that comes by default with Linux
called the X file manager. You can open it by typing xfm
on the command line to access the X file manager.

We'll start by creating files and directories on the command


line, then we'll review how this is done in the GNU Midnight
Commander. The FlipBook below describes how this is
done.

Transcript

Next lesson The next lesson wraps up this module.

Exercise
Before moving to the next lesson, click the Exercise button
to complete a lab exercise on exploring the directories on
your system.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

This module began with a discussion of the Linux


filesystem. We talked about the directories found in the
Linux filesystem hierarchy, and what you might expect to
find in each. You learned about GNOME, the graphical
interface for Linux, and how to work with the GNU
Midnight Commander (GMC) file manager. Finally, you
learned about relative and absolute paths, different file types,
and how to navigate the Linux filesystem and work with files
and directories using some basic Linux commands.
Having completed this module, you should be able to:
● Describe the Linux filesystem hierarchy

● Describe the Linux directory system

● Describe the purpose of the various user directories


and the home directory
● Explain the role of the GNOME file manager

● Describe the features and functionality of the GNU


Midnight Commander
● Use GMC to sort files

● Navigate the Linux filesystem using relative and


absolute paths
● Demonstrate the use the ls and pwd commands

● List the different file types and determine the file type
from the command line
● Identify file type in GMC

● Create files and directories on the command line


New terms ● MS-DOS
● file manager
● GNOME
● GNU Midnight Commander
● binaries
● blocks
● desktop environment
● kernel module
● libraries
● root user
● superuser
● terminal

● ASCII

Coming up The next module introduces you to the use of special


characters.

Quiz
Before moving on to the next module, click the Quiz button
to complete a quiz on the material covered in this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File and directory manipulation
Creating files and directories (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

File and directory manipulation


Lab: exploring the directories on your system
Objective
List the file types in various system directories.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Now that you have a greater understanding of how to tell what is in your Linux filesystem, it is time to
take a closer look.
Instructions
Log into the lab (which starts you in your home directory) and then complete the following tasks:
1. Determine what kinds of files are contained within the /dev directory.
2. Determine what kinds of files are contained within the /bin directory.
3. Determine what kinds of files are contained within the /tmp directory.
Hints
Remember the following commands:
1. The file command displays the type of a specific file.
2. The ls -l command lets you see the file types for an entire directory.
3. The cd command changes directories.
4. You can also use GMC to complete this exercise if you wish. Even better, use both and compare
the two!
Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using special characters
Module introduction
The shell is the command line interpreter that takes input
from the user and translates the command into kernel
instructions. This is useful, but there are some characters you
might type on the command line that have more than one
meaning. These are called special characters. Special
characters are used in a number of situations in the Linux
environment. They can be used on the command line, in
programming, and even in X Window systems.
Special characters can make your life easier by allowing you
to abbreviate long commands. When a special character
appears in a command, the system will interpret it as a
request to match certain things. For example, you may want
to find a number of files rather than just one. Rather than
retrieving each one separately, you can write your command
in such a way that all of the desired files will be retrieved at
once. This would be a rather long command if you wrote it
out the conventional way, but using a special character will
convey the same meaning in a shortened form. We will
discuss several examples of this below to make the concept
clear. The special characters we'll discuss will be the ones
used most often in the shell.
After completing the lessons and learning checks in this
module, you will understand how to:
● Identify the most common wildcard characters and
their meanings
● Explain the usefulness of the tilde and the dollar sign
as special characters
● Explain how special characters are used to help
increase productivity
● Explain how special characters are used with GMC

● Explain how the shell interprets double quotes


Next lesson In the next lesson, you will learn to identify the most
common special characters and their meanings.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Linux filesystem
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.

1. You start in the directory /root and want to go to the directory /home/bob.
How might you get to this directory using the relative directories path?
Please select all the correct answers.
A. cd ../home/bob
B. cd /home/bob
C. cd ..; cd /home; cd bob
D. cd ~

2. What command would you use to find out where you are in the Linux directory
tree?
Please select the best answer.
A. ls
B. ls -la
C. cd
D. pwd

3. What ls flag or option do you need to be able to see files starting with a dot?
Please select the best answer.
A. -l
B. -a
C. -s
D. -d
4. Which of the following cd commands will get you to your home directory
(your username is fred) from the /home directory?
Please select all the correct answers.
A. cd /home/fred
B. cd ~
C. cd ../fred
D. cd fred

5. You type ls -l in /dev. What letter will be at the beginning of the listing
for your mouse's device driver?
Please select the best answer.
A. b
B. c
C. d
D. -

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Wildcard special characters
Identify the most common wildcard characters and
their meanings.

Wildcards
You may know of the term "wildcard" as it relates to
playing a card game; a wildcard is a card that can take the
place of many other cards. Similarly, in Linux, a wildcard is
a type of special character that can tell the system to find
many different things for you. There are three types of
wildcards:
1. The string wildcard
2. The single character wildcard
3. The range wildcard

When you use a wildcard character, you are asking the


system to find everything that matches a particular pattern.
The type of wildcard character used determines the pattern
matched.

Three common The asterisk (*): a string wildcard


wildcards
The most common wildcard used is the * character. It is a
"string" wildcard because you use it to draw the system's
attention to a string of characters. For example, if you want
to look at a listing of all the files in a particular directory that
have the .txt extension, enter the expression *.txt. The
* character tells the system that the string of characters after
it (.txt) is something that it should be looking for in your
directory. It will look, and then return a list of many different
files, all of them ending in the string .txt. This is much
more convenient than writing a command that requests each
file separately.
The question mark (?): a character wildcard
A similar special character is the single character wildcard ?.
It is different from the * character because this symbol ? is
only used to match one character, not a whole string. The ?
character is used in a situation where you are searching for
something and you know all the characters except one. Enter
the name of the item you are seeking and put a ? in place of
the single character you don't know. The system will ignore
the character you didn't know (represented by ?), look for the
characters that you did know, and match them up with the
files in your directory.
The brackets ([]): a range wildcard
Lastly, you can match a range of characters with the range
wildcard []. You indicate the range of characters that you
want matched, surrounded by square brackets. You can use
individual characters, such as 123, or a range of characters
separated by a dash (-), as in [a-z].

The following table shows the use of these three wildcard


special characters.

Character Type This example ...could return


command... the following
example files:
* String ls *.txt file1.txt file2.txt
wildcard file3.txt
file33.txt
file52.txt
file53.txt

? Single ls file3?.txt file33.txt


character
wildcard

[ ] Range ls file[a-z].txt filea.txt fileb.txt


wildcard fileq.txt filez.txt

The first example in the table uses the string wildcard to list
all the files that end in .txt. The second example uses the
single character wildcard ? to find only files that start with
file3, end with .txt, and contain any character in the
middle. The third example uses the range wildcard to find
files with file at the beginning followed by any lowercase
character (a-z), and .txt at the end.
Next lesson In the next lesson, you will learn about two other special
characters: the tilde and the dollar sign.

Exercise
Before moving on to the next lesson, click the Exercise
button to test your knowledge of special characters.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Other important special characters
Explain the usefulness of the tilde and the dollar
sign as special characters.

Other special
characters
All wildcards are special characters, but not all special
characters are wildcards. In addition to the wildcard special
characters we have discussed, two other very useful special
characters are the tilde ~ and the dollar sign $. The tilde
represents the user's home directory, (which is
/home/redhat in our lab environment). The dollar sign
is used for "variables" (identifiers that have a value
associated with them). When it appears in the shell it
indicates a "shell variable", which is basically a regular
variable that provides special information to the shell for the
purpose of customizing the environment. The tilde is often
used to abbreviate your command. For example, if you type:

redhat@localhost redhat]$ ls ~

You will see all the files in the /home/redhat directory.


The most
The following table lists the most common and useful special
common
characters in Linux and their meanings. Some of these
special
characters may be unfamiliar at this point, but we will
characters
discuss them when you need them later in the course.

Next lesson In the next lesson, you will learn how to use special
characters to increase productivity.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Wildcard special characters


Special characters
Objective
Define the meaning of common special characters.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are three special character names with their corresponding symbols in the right
column. Click once on a name in the left column, then click once on the symbol in the right column to
make a match.
When you think you have all of the names and their symbols matched, click the Done button and you'll
see whether or not they matched up correctly--green lines mean the match is correct, red lines mean the
match is incorrect. If you didn't get the matches right the first time, click Clear to erase your matches and
try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Command line uses for the special
characters
Explain how special characters are used to help
increase productivity.

The reasons
for special
Special characters are used on the command line when
characters attempting to abbreviate a command or search for a string.
The shell reads your command line in chunks known as
words. When you hit the Enter (or Return) key, the shell will
take these words and examine them for any special
characters. If any special characters appear, they will be
replaced with the meaning they represent. Therefore, these
special characters act like red flags for the shell, indicating
when it should employ certain behavior.

When you use special characters on the command line you


require fewer keystrokes to get your desired results. This
increases your productivity. For example, if you were typing
in a command that had ten subdirectories in the name, you
could create a shell variable that contained the full path
name. Then you would only have to type the one variable
name to run the command on the command line. Another use
for special characters on the command line is while listing
the contents of directories in your current directory. Instead
of typing ls dirname for each directory, you could
simply type ls * and it would list all the files in each
directory automatically, decreasing the number of commands
you have to type.

Next lesson In the next lesson, you will learn how special characters are
used with GMC.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice using the special characters we have
discussed in this lesson.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using special characters with GMC
Explain how special characters are used with GMC.

When to use
special
The default file manager that comes with GNOME is the
characters called the GNU Midnight Commander (GMC). GMC is a
with GMC component of the GNOME desktop environment, which
presents your directory structure and files to you in a
graphical manner. The window is separated vertically, with a
tree showing all directories on the left side, and an area
showing all files on the right side. The file listing can be
viewed as icons, which helps users determine what file types
they are seeing--whether they are directories themselves,
binary files, or text files. GMC allows you to graphically
view the contents of directories and easily navigate around
the Linux filesystem. For example, you could quickly list all
the files which contain the dollar sign character $, and view
them by clicking the file name with the mouse.
You'll use special characters in the GMC environment almost
as frequently as in the command line interface. These will be
interpreted just as they would in the shell. The convenience
is that you'll be able to quickly identify file types due to the
distinct icons used in GMC.
Shell special characters can be used when working with
GMC. To enable this format use the following steps:
● Select Preferences from the Edit menu

● Select Use shell patterns instead of regular expressions

Once the correct option is set, special shell characters can be


used for many commands in GMC. One example is
illustrated in the following FlipBook.

Transcript
Next lesson In the next lesson, you will learn how the shell interprets
double quotes.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Command line uses for the special characters
Examples of two useful commands
The following examples demonstrate two commands that can
make a potentially time-consuming task very efficient. The
first command copies every file in one directory to another,
which would take much more time if you were to specify
each file individually.

You must use: In order to:


cp /bin/* Copy the entire contents of a source directory to the
working directory

file a* Determine the file types for all files in a directory that
begin with the letter "a"

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Command line uses for the special characters


Lab: using special characters
Objective
Use special characters to achieve the desired results.
Scoring
This exercise is worth 5 points. To receive full credit, you'll need to cut and paste your answer into the
text box and click the OK, I'm Done button in order to submit it to a tutor.
Background
Enter the course lab to do this exercise.
Instructions
Put your new knowledge to the test by trying the following special characters in the Linux environment.
This lab will demonstrate how special characters can be used to boost productivity.

Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted
with a password: prompt. Enter your password here. You should now see the shell prompt like this:

[redhat@localhost redhat]$

Step 2: List the files in the /etc directory which begin with "host". To do this, use the command:

[redhat@localhost redhat]$ ls
/etc/host*

Step 3: List any files or directories in the /etc directory which only have three letters in their name and
begin with the letter "r", for example:
[redhat@localhost redhat]$ ls /etc/r??

Step 4: List all the files in the redhat user's home directory, using the tilde to indicate the username:

[redhat@localhost redhat]$ ls ~

If you have problems or questions about this lab, please contact a tutor with your concerns.
Submitting your exercise
Enter your answer into the text box below. Click the OK, I'm Done button to submit the code to a tutor.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using double quotes to prevent
interpretation of special characters
Explain how the shell interprets double quotes.

When and why


you would
As mentioned earlier in the module, there are certain
eliminate characters that are interpreted in a special way by the shell.
special The special meanings of these characters provide you with
meaning very useful shortcuts when typing on the command line.
There may be times, however, when you wish to use one of
these characters for another reason, and you would like it to
be interpreted with its literal meaning rather than its special
meaning. At these times, there is a process you can use to
force the shell to ignore the special meaning of the character
in question, and interpret it in its literal state. This process is
called quoting.

How to You might need to eliminate special meaning if one of your


eliminate filenames has a character in it that is identical to one of the
special special characters we've discussed. For example, consider the
meaning file name: ben&jerry.txt. When you type in this
filename, you will want to make the shell understand that the
ampersand character (&) is in this case not to be interpreted
with the special meaning that the Linux operating system
usually assigns to it (background job). Rather, you want the
shell to interpret the ampersand with its literal meaning--as a
part of the filename you are trying to access. You are
presented with a problem; how can you view the filename
ben&jerry.txt without causing the ampersand (&) to be
interpreted as a special character? There is a way of
eliminating the special meaning from this and all other
special characters; if you put double quotes around the whole
string "ben&jerry.txt" this prevents anything between
those double quotes from being interpreted as a special
character by the shell. An alternate method that has the same
effect is to put a backslash ( \ ) in front of the special
character itself. This will cause the shell to use everything
following the backslash as a filename. These two examples
are shown below:
[redhat@localhost redhat]$ more
"ben&jerry.txt"
[redhat@localhost redhat]$ more
ben\&jerry.txt

The following FlipBook illustrates the use of double quotes


for the purpose of preventing interpretation of special
characters.

Transcript

Exercise
Before moving on to the next lesson, click the Exercise
button to practice using double quotes.

Next lesson The next lesson wraps-up this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using special characters with GMC
Using special characters with GMC
(FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

In this module you learned about special characters and their


uses. You also practiced using special characters in your lab.
As we discussed earlier, the ability to use special characters
both on the command line and within the graphical
environment are practical skills you will use quite often. You
will be able to use these skills in future lessons when asked
to do any task that requires a list of files to be produced.
Now that you have completed this module and its exercises,
you should know how to:
● Identify the most common wildcard characters and
their meanings
● Explain the usefulness of the tilde and the dollar sign
as special characters
● Explain how special characters are used to help
increase productivity
● Explain how special characters are used with GMC

● Explain how the shell interprets double quotes

New terms Here are some of the new terms you encountered in this
lesson.
● GMC

● Shell

● Special character

Coming up In the next module, you will learn about file manipulation
and location.

Exercise
Before moving on to the next lesson, click the Exercise
button to review the use of special characters.
Quiz
Before moving on to the next lesson, click the Quiz button to
review what you have learned in this lesson about special
characters.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using double quotes to prevent interpretation of special
characters
Double quotes and special characters
(FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Using double quotes to prevent interpretation of special characters


Using double quotes
Objective
Use double quotes to eliminate special meaning.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but you will not submit your
response to a tutor.
Instructions
Test your knowledge by trying the following examples in the lab environment.
Step 1: You will be prompted with a Login: prompt. Enter your username, then you'll be prompted with
a Password: prompt. Enter your password here. You should now see the shell prompt like this:
username@redhat $
Step 2: Type ls * without quotes. It will list all files in the current directory.
Step 3: Now type ls "*" and see what files are listed.
Step 4: Use the echo command to show your home directory: echo ~
Step 5: Now use the same command with quotes around the tilde: echo "~"
Step 6: Log off the system using the exit command.
If you have problems or questions about this lab, please contact a tutor with your concerns.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File manipulation and location
Module introduction
One of the things most people want or need to do under any
operating system is view and work with files. Linux has an
assortment of commands that allow you to do a wide variety
of things with your files (text files in particular). The GNU
Midnight Commander also offers a range of similar features.
By the end of this unit, you will be able to:
● Create and move files and directories using the cp and
mv commands
● Copy and remove files and directories using rmdir,
rm, and the GMC
● Use the less, more, cat, head, and tail
commands to view text file contents
● Use pipes and redirection to manipulate data's
destination
● Use the slocate, find, and which commands to
search the filesystem

● Describe how grep is used and use it to find a search


string

Next lesson In an earlier lesson, you learned how to create and move files
and directories. Now, let's look at this skill in more detail.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Module wrap-up
Understanding special characters
Objective
Find and use the appropriate special character to solve a problem.
Scoring
This exercise is worth a total of 5 points. To receive full credit, you'll need to cut and paste your answer
into the text box and click the OK, I'm Done button in order to submit it to a tutor.
Background
Enter the course lab to do this exercise.
Instructions
Step 1: Log in to the system.
Step 2: Change into the /home/username/exercise1 directory.
Step 3: List all files that have seven-character file names.
Step 4: First produce a list of files which begin with the pattern file, then a listing of files which have a
tilde (~) at the end of the file name. You'll need to use all the commands you have learned to produce this
list.
Step 5: Submit this list to the tutor below. (You can cut and paste from your terminal window.)
Submitting your exercise
Enter your answer into the text box below. Click the OK, I'm Done button to submit your solution to a
tutor.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Special characters
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which of the following is a string wildcard special character?
Please select the best answer.
A. The dollar sign ($)
B. The tilde (~)
C. The ampersand (&)
D. The asterisk (*)

2. The expression file* will list files that contain what pattern?
Please select the best answer.
A. Any file beginning with the string file
B. Any file ending with an asterisk (*)
C. All files that end in .txt
D. Only the file named myfile.txt

3. Your home directory is indicated by which special character?


Please select the best answer.
A. The asterisk (*)
B. The tilde (~)
C. The square brackets ([])
D. The dollar sign ($)
4. What file will the following pattern list?
temp[12BC].txt
Please select the best answer.
A. TEMP1.txt
B. tempC.txt
C. temp12B.txt
D. temp33.txt

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Creating and moving files and
directories
Create and move files and directories using mv,
touch, mkdir, and the GMC.

Some of the most basic file manipulation operations


involve creating new files and moving them around. You can
do this in Linux both at the command line and in the GMC.

Creating files As you know from an earlier module, you can create new
using the files in Linux using several commands. As seen in the image
touch below, the touch command uses the syntax touch
command [file]. This command creates an empty file with the name
specified on the command line.

You can create several files at once using the touch


command. Let's try it, using the Command Line QuickCheck
below.
Moving files To move files and directories in Linux you use the mv
using the mv command. This command actually serves two functions.
command 1. To move the file or directory from one location or
another
2. To rename the file or directory without moving it at all

The syntax for moving files is as follows:

mv [original] [new]

The image below indicates how this command might be


used.

Click the Code button to see an annotated version of the code


above.
Most file manipulation commands understand both absolute and
relative file and directory locations. Both mv and touch do.

Creating files As you know, you can also move and create files in GMC.
in GMC
To create a new file in the GMC:
1. Open the GMC.
2. Change to the directory you want to create the file in.
3. Click Commands, Run Command to open the Enter
Command to run dialog box.
4. Type touch [file] for the file you want to create
within the current directory.

5. Click OK to create the file.

You may need to click the Rescan button before this file shows up
properly in the listing.

Moving files in You have two options available when moving files in the
GMC GMC: drag-and-drop or menu. Which you choose is more
often than not the one you are most comfortable with.
To move a file using drag and drop:
1. Open the GMC.
2. Change to the directory containing the file you want to
move.
3. Click on the file and do not release the mouse button.
4. Drag the file onto the directory you want to move it
into. If this directory is hidden inside another
directory, then pause over the unexpanded directory
until it expands to show the subdirectories, and then
drag it onto the subdirectory.

5. Release the mouse button. The file is moved for you.


Moving a file To move a file using the menus:
using menus 1. Open the GMC.
2. Change to the directory containing the file you want to
move.
3. Click the file you want to move.
4. Select File, Move to open the Move dialog box.
5. Either type the path to the directory you want to move
the file to in the text box, or click the Browse button to
navigate the tree through the GUI.

6. Once you have your location entered, click OK to


move the file.

Next lesson In the next lesson, you'll learn how to copy and delete files
on the command line.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice creating and moving files on the command
line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Copying and removing files and
directories
Copy and remove files and directories using rmdir,
rm, and the GMC.

The last basic set of tools in your filesystem manipulation


toolbox is the ability to copy and delete files. You can
accomplish both of these tasks from the command line, and
by using the GMC.

Let's start by reviewing how files are copied and deleted on


the command line.

Copying files One of the most common file manipulation commands you'll
using cp use is the cp command.
The cp command is used to copy files or directories. For
example, if you wish to copy a file from your home directory
into a new subdirectory, the cp command would make a
copy of the source file in the specified directory.

The syntax is as follows:

cp [options] source dest

If the source includes more than one file, the dest must
be a directory. For example, perhaps you have the directory
/home/redhat/files and want to subdivide it into
types of files. One of these might be
/home/redhat/files/text. To copy all the text files
(which you ended with the extension .txt) into this new
subdirectory, you might type the following from inside
/home/redhat/files.
cp *.txt text

Copying You may wish to copy a directory and its contents to another
directories location. Directories may be copied with an appropriate
using cp option. There are a few options you might find interesting.
They are listed in the following table.

Option Purpose
-f If a file with the name of the file you are copying already exists in
the location you are copying to, overwrite it automatically.
-i If a file with the name of the file you are copying already exists in
the location you are copying to, always ask whether to overwrite
or not.
-r Copy contents recursively, including subdirectories.
-u Check to see if a file with the same name already exists in the
destination point. If so, check to see if the existing file is older than
the one being copied. If it is older, replace it. If the file is not
already there, make the copy.

The syntax is as follows:

cp [options] source dest

For example, to copy the directory testdir and all its


contents to newtest (both within /home/redhat), you
would type:

cp -r testdir newtest

As always, remember that you can use relative or absolute


locations with cp.
Deleting files The more general syntax for deleting directories is as
and follows:
directories
using rm
rm [options] [file...]

You use this command to delete files. If you use the rm -r,
you can also delete directories.
The rm command has a built-in safeguard that prevents you
from deleting a file or directory that is not empty. When you
use the rm command to delete a file or directory that
contains data--for example, a file that has text in it instead of
an empty one created with the touch command--rm will
ask you whether you really want to delete the file (y/n).

You can disable this default reminder with the combination


rm -f.

Deleting You can delete empty directories (meaning that anything


directories they contain has to be deleted first) using the rmdir
using the command.
rmdir
command The syntax for deleting directories is as follows:

rmdir [dirname]

See the following image for an example of how you might


use this command.
Deleting files You can of course delete files and directories in GMC. The
and FlipBook below describes how this is done.
directories in
GMC

Transcript

You need only have accidentally deleted a large group of


important files or directories once to learn this lesson: be very
careful with the combination rm -rf*! Be especially cautious
when you are logged in under the root account, which has access
to all your important system directories.

Now that you can create, move, copy, and remove files and
directories, you have all the basic file and directory
manipulation tools at your disposal!

Next lesson Being able to send the output of one command as the input to
another is extremely useful. You'll learn about file
redirection and pipes in the next lesson.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice copying and removing files and directories
on the command line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Creating and moving files and directories


Lab: creating and moving files on the command line
Objective
Create and move files and directories on the command line.
Scoring
This exercise is worth a total of 5 points. To receive full credit, you'll need to cut and paste your answer
into the text box and click the OK, I'm Done button in order to submit it to a tutor.
Background
Enter the course lab to do this exercise.
Instructions
Do the following to complete this exercise.
1. Create a directory in your lab home directory called testdir
2. Rename testdir to testdir2
3. Create three empty files in testdir2: file1, file2, and file3
4. Create a directory in your lab home directory called testdir3
5. Move the three files in testdir2 into testdir3
Submitting your exercise
Enter your answer into the text box below. Click the OK, I'm Done button to submit your solution to a
tutor.
Hints
Remember the following commands: touch, mv, and cd. Also, you can use either relative or absolute
methods for this lab.
Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Viewing text files using less, more, cat,
head, and tail
Use the less, more, cat, head, and tail commands to
view text file contents.

Now that you know how to work with directory structure, it


is time to learn how to work with the files within the
directories. There are a series of commands you can use to
view various aspects of a file's data.

Viewing text The less, more, cat, head, and tail commands each
files using less provide a quick way to view the full contents of a text file.
and more
The syntax for using less and more is as follows.

less [file...]

more [file...]

Both less and more display the information a screen at a


time, and wait for you to press the spacebar before moving
on to the next screen.

The difference You will not notice many differences between these two
between less programs until you learn later how to search for text inside
and more them. The less command highlights the text it finds in a
search, which is very helpful! The less command is similar
to more, but is slightly more modern.
Viewing text The head and tail commands show data from either the
files using beginning or the end of a text file.
head and tail
The syntax for using head and tail is similar.

head [options] [file...] tail


[options] [file...]

The head and tail commands display (by default) the


first ten lines of the beginning or end of the file respectively.
The options available with these two commands are listed in
the table below.

Option Description
-c Print amount of text corresponding to the given size. You have
three available sizes: b for bytes, k for KB, and m for MB. No
included size defaults to bytes.
-n Print amount of text corresponding to the given number of lines.
-q Do not print information about which file's lines are being
displayed.
-v Print information about which file's lines are being displayed.

By using the -n flag (option), you can specify a greater or lesser


number of lines of output. The syntax would be as follows: head
-n 5 file1
Viewing an The cat command is derived from the word concatenate,
entire file which means to link together in a series or chain. The file
using cat contents are displayed sequentially with no breaks.

The syntax for using cat is as follows:

cat [options] [file...]

Because file contents are displayed in a steady stream, the


cat command is used more often in conjunction with other
commands than it is actually used to view files.

For example, if you have a very long file, cat will


concatenate the entire contents of the file, and it will scroll
past you too fast to be able to read it. The answer to this
dilemma is to use the less and more commands in
conjunction with cat, or, to just use less or more. The
FlipBook below describes how to use cat, head, and
tail, to view a file.

Transcript

Next lesson In the next lesson, you will learn how to run searches
through your filesystem.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice using the commands you just learned to
view files.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Copying and removing files and directories
Copying and deleting files at the
command line and in GMC (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Copying & removing files and directories


Lab: copying and removing files and directories on the command
line
Objective
Copy and remove files and directories on the command line.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to get more familiar with using the cp and rm commands to copy and remove
files.
Instructions
Log into the lab, which starts you in your home directory (structured as shown in the following image):

You are currently in the /home/redhat directory.


Using the directory diagram, do the following:
1. Using one command, make a complete copy of the testdir directory (including all files and
subdirectories) called testdircopy, which should also reside in /home/redhat.
2. Using one command, make a complete copy of the subdir1 directory (including all files and
subdirectories) called subdircopy, but place this copy in /home/redhat.
3. Using one command, create the files testfile1 and testfile2 in testdir.
4. Verify that your copies were successful.
5. Using rm, delete subdircopy.
6. Using rm, delete the contents of testdircopy.
7. Using rmdir, delete testdircopy.

8. Verify that your deletions were successful.

Remember to be doubly careful if you decide to use rm -rf.

Hints

Not all of these steps have to be completed independently. You can use multiple commands if necessary
unless otherwise specified.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Manipulating process output
Use pipes and redirection to manipulate data's
destination.

Using pipes
and
There are a number of tools available in Linux that allow
redirection you to alter where data goes. These tools typically fall into
two types: redirection and pipes. As you get more involved
using Linux on a regular basis, you will need a solid
understanding of these tools.

Redirecting The term redirection in this context refers to taking data that
data was meant for one end destination and assigning it a new end
destination. Before you learn how redirection occurs, you
need to understand standard input, standard output, and
standard error. These are explained in the table below.

Source or Destination Definition

STDIN STandarD INput. This refers to a character


device used to enter data used by the system.
Typically, STDIN refers to the keyboard.

STDOUT STandarD OUTput. This refers to a character


device used to receive data from the system.
Typically, STDOUT refers to your monitor.

STDERR STandarD ERRor. This is often the most


difficult concept to grasp. Some programs send
their error messages to your screen, or a
particular virtual terminal. Whatever the
destination, it is often defined by the program to
be STDERR.
Symbols used There are several symbols used in data redirection. The most
in redirection common ones are listed in the View Table to your left, along
with conceptual images representing what they do.

There may be times when it is useful to redirect output that


you have no specific use for. In this case, you might redirect
to a location called /dev/null.

Using pipes to Pipes allow you to take the output of one command and send
connect it as the input for another, as represented by the image below.
processes

The symbol used to denote a pipe is the "|", which is the


vertical bar on your keyboard. Usually it is on the key as a
vertical dashed line in two parts. An example of pipe use
might be ls -C | more.

Next lesson In the next lesson, you will learn many ways to view file
contents.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a matching exercise on file redirection
and using pipes to connect processes.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a lab exercise on file redirection.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Viewing text files using less, more, cat, head, and tail
Viewing first and last lines of a file
using cat, head, and tail (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Viewing text files using less, more, cat, head, and tail
Lab: viewing text files using less, more and cat
Objective
View text files from the command line.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to practice viewing text files using the less, more, and cat commands.
Instructions
Log into the lab, which starts you in your home directory (structured as shown in the following image).

You are currently in your home directory, /home/redhat.


Using the directory diagram, do the following.
1. Using a single command, view the contents of /etc/inittab without having it show you the
data one page at a time.
2. View the contents of /etc/inittab one page at a time, using two different methods.
Hints
Not all these steps have to be completed independently. You can use multiple commands if necessary.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Use the slocate, find, and which
commands
Use the slocate, find, and which commands to search
the filesystem.

Your filesystem is a big place, with many directories and


subdirectories. There are times when you'll need to locate a file
within the filesystem, but you have no idea where it is. This is
one reason to try to be consistent with where you put files and
install programs.

Fortunately, there are several commands available to you to help


you track down the items you have misplaced. They include the
which, slocate, and find commands.

Using which to The which command searches through the directories in your
search for path statement for the pattern or string you designate. You use it
programs specifically to find programs you want to run. These programs
have to be within the set of directories that Linux looks in by
default whenever you try to run a program (the path statement).

The syntax for using which is listed below.

which [pattern]

An example is as follows.

which httpd

In this example, which will find the binary (executable) file


within your main path called httpd. The file name must be
exact. The result of the above example would give you:

/usr/sbin/httpd

If which finds the search string, it displays the filesystem


location of the matching file. This is the best way of finding out
exactly which command is running when you type something at
the command line.

To see what your path actually consists of, type echo $PATH.

Using slocate The slocate command operates differently from the which
to search your command in one important way. The which command only
filesystem searches the contents of your path. The slocate command
structure looks everywhere in your filesystem.
A "snapshot" of your filesystem is captured at 4am every
morning. Instead of searching on the live filesystem, slocate
searches the most recent "snapshot" version of the filesystem.

The syntax for using slocate is listed below.

slocate [pattern]

For example, when searching for the string profile you would use
the following.

slocate profile

Using slocate is the best way of finding something that you


created before the database was last rebuilt--in other words, a
document you created before four a.m. the same day. In this case,
slocate profile will find all file names and directories that
contain the word "profile." For example, the first four terms
slocate found might be:

/etc/profile
/etc/profile.d
/etc/profile.d/colorls.csh
/etc/profile.d/colorls.sh

Note that files called Profile will not be found. As far as


slocate is concerned, Profile and profile are two
different strings.

Using find to The find command searches through the live filesystem.
search your
filesystem The syntax for using find is listed below.
structure

find [options] [path] [pattern]

Example:

find / -name profile

In this case, the command line will find files that are named
"profile." For example, the following search might turn up.

/etc/profile
/usr/lib/tclX8.0.4/help/tcl/debug/profile
Unlike slocate, find looks for an exact match. A file called
Profile will not be found, but neither will a file called
profile.d.

The find command is by far the most complex and flexible of


the search commands. As you learn more about Linux, you will
learn more about how to use find efficiently.

Next lesson In the next lesson, you will learn how to search through text.

Exercise
Before moving on to the next lesson, click the Exercise button to
practice using the commands you just learned to find files.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Manipulating process output
Introduction to /dev/null
Although it does not actually exist, /dev/null
(pronounced "dev null") is a place that people sometimes
find useful to send data to. It's often referred to as the "bit
bucket" because it's like sending bits and bytes into the trash.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Manipulating process output


File redirection and using pipes to connect processes
Objective
Use commands to redirect files and pipes to connect processes.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five commands and their corresponding output in the right column. Click
once on a term in the left column, then click once on the definition in the right column to make a match.
When you think you have all the terms and their definitions matched correctly, click the Done button to
see whether or not you've matched the terms correctly--green lines mean the match is correct, red lines
mean the match is incorrect. If you didn't get the matches right the first time, click Clear to erase your
matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Manipulating process output


Lab: file redirection
Objective
Manipulate process output using pipes and redirection.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to practice file redirection and piping data.
Instructions
Log into the lab, which starts you in your home directory (structured as shown in the following image):

You are currently in the /home/redhat directory. Using the directory diagram, do the following:
1. Using a single command, redirect the output of the who command to the file
/home/redhat/testdir/who_output.
2. Verify that the action was successful by viewing the contents of
/home/redhat/testdir/who_output.
3. Using a single command, append the contents of a long format directory listing of
/home/redhat to the file /home/redhat/testdir/who_output.
4. Using a single command, send the output of the long format directory listing of /tmp through the
more program.

Hints
Not all of these steps have to be completed independently. You can use multiple commands if necessary.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using grep to find search strings
Describe how grep is used and use it to find a
search string.

As you learned in earlier lessons, Linux provides several


commands that allow you to conduct a search of your
filesystem structure. There are also commands, like grep,
that let you search through the files themselves.

In other words, you can search when the files are text files.
You cannot use grep on compiled programs because these
files are not text files.

Search for text The grep command searches for patterns within text. The
in files using syntax for using grep is listed below.
grep

grep [pattern] [file]

The grep command can also be used to search multiple files


for the same pattern. An example is as follows.

grep penguin file1 file2 extra

In this example, grep will search the files file1, file2


and extra for the string penguin.

As you can see from the two different syntaxes listed, you
can use grep to search through the contents of a text file, or
search through output piped from another command.
Options The grep command has a number of options available. The
available with ones you might find most useful are listed in the table below.
grep Click on the View Image button to see the first 5 pages of the
file used in this example, then review the examples included
in the table below. This file is included in your user
directory.

Click each command to view its output.

Option Command Result

grep -A 4 Aster Output number of


-A # lines of context after
lwmen10.txt
the actual match.

Output number of
grep -B 4 Aster lines of context
-B number
lwmen10.txt before the actual
match.

Output number of
grep -C 4 Aster lines of context
-C number around the actual
lwmen10.txt
match (above and
below).

Ignore upper and


-i grep -i Aster lwmen10.txt
lower case issues.

Output the line


-n grep -n Aster lwmen10.txt number for the
matching lines.

Next lesson The next lesson wraps up this module.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete an exercise using the commands you just
learned to find strings in files.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Use the slocate, find, and which commands


Lab: finding files using slocate and find
Objective
Use the find and slocate commands.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to practice viewing text files using the which, slocate, and find commands.
Instructions
Log into the lab, which starts you in your home directory. The filesystem is shown below.

You are currently in the /home/redhat directory. Do the following.


1. Use the which command to track down httpd.
2. Use the slocate command to track down httpd.
3. Use the find command to track down httpd.
4. Make note of the very different selection of items you get back from each commands, and what
their output is like.

Hints
Not all of these steps have to be completed independently. You can use multiple commands if necessary.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

You now have many of the tools you need to round out your
abilities to work within the Linux filesystem. In fact, you
know enough to be able to explore your own machine
through a combination of searching and viewing file
contents. Take some time to become familiar with the tools
you now have at your disposal.
Now that you have completed this module, you are able to:
● Create and move files and directories using the cp and
mv commands
● Copy and remove files and directories using rmdir,
rm, and the GMC
● Use the less, more, cat, head, and tail
commands to view text file contents
● Use pipes and redirection to manipulate data's
destination
● Use the slocate, find, and which commands to
search the filesystem

● Describe how grep is used and use it to find a search


string

New terms Here are some of the new terms you encountered in this
module.
● concatenate

● pipe
● redirection
● STDIN
● STDERR

● STDOUT
Coming up File access permissions are one of the most powerful features
of Linux. In the next module, we'll discuss file access
permissions.

Quiz
Before moving on to the next lesson, click the Quiz button to
review what you learned in this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Using grep to find search strings


Lab: using grep to view text files
Objective
Use the grep command to view text files.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Here is your chance to practice viewing text files using the grep command.
Instructions
Log into the lab, which starts you in your home directory, and then do the following.
You are currently in the /home/redhat directory.
1. Access the contents of /etc/passwd, and redirect them to /home/redhat/passwds.txt.
2. Search the contents of /etc/passwd for your login name (redhat).
3. Do this search again, but this time redirect the results to /home/redhat/myentry.txt.

Hints
Not all of these steps have to be completed independently. You can use multiple commands if necessary.

Lab HOWTO
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File access permissions
Module introduction
Linux is regarded as a very secure operating system because
it has the ability to allow or deny access to files and
application programs. This is important if the system has
many users working independently; if one of those users
attempts to delete system files either purposely or
accidentally, the action will be denied. The file access
permissions are what provide this valuable feature to Linux.
Permissions are one of the most fundamental concepts you
will learn, and having a solid understanding of how they
work will make you a better Linux user.
By the end of this lesson, you will have learned how to:
● Define file access permissions

● Describe how to change permissions in Linux

● Describe how security is managed in Linux

● Demonstrate how to change permissions with GMC

Next lesson In the next lesson, you will learn about file access
permissions.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Module review
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which of the following commands allows you to rename a file?
Please select the best answer.
A. ls
B. rm
C. mv
D. cp

2. Which of the following commands can be used to display a text file's contents?
Please select all the correct answers.
A. ls
B. more
C. less
D. cat

3. Which of the following commands can you use to search for something within
the filesystem?
Please select all the correct answers.
A. which
B. grep
C. slocate
D. find
4. Which of the following commands below takes output from the ls -l
command and passes it on to more, then displays the final output one page at a
time?
Please select the best answer.
A. ls -l >> more
B. ls -l < more
C. ls -l > more
D. ls -l | more

5. Which of the following allows you to save the result of the command which
slocate to the file output?
Please select the best answer.
A. which slocate > output
B. which slocate < output
C. which slocate 2> output
D. which slocate | output

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux file access permissions
Define file access permissions.

File access permissions are an effective form of security in


the Linux environment. There are three categories of
permissions available:
1. Read permission
2. Write permission
3. Execute permission
As these category names indicate, a file can have read
access, write access, or execute access. Along with this,
access can be granted or denied to three types of users:
1. The owner
2. The group
3. Other users (everyone else)

Owner permission pertains to the owner of the file, group


permission is for users who are in the owner's group, and
"other" permission indicates all other users who may be on
the Linux system.

Determine When you are looking at your files you can determine the
your level of level of access granted by using the ls -l command,
access which is the long listing that shows all attributes for a file.
For example, the following output shows the file attributes
for temp.txt.
The access permissions are shown at the far left, (specifically
the portion which reads -rw-r). The first character
indicates the file type. In the example it's a dash, which
means it is a regular file. The following nine locations
indicate the owner, group, and other permissions, in order of
read, write, and execute from left to right.
The following MouseOver allows you to look at the previous
ls -l more closely and define each part of the expression:

Transcript

Next lesson In the next lesson, you will learn how to change permissions
from the command line.

Quiz
Before moving on to the next lesson, click the Quiz button to
review how permissions are used in Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Changing permissions from the
command line
Describe how to change permissions in Linux.

Changing
permissions:
As noted in the previous lesson, permissions control the
the numeric level of access that is given for particular files. They can be
method modified so as to grant or deny access for the owner, the
group, and for all other users. The command that changes the
permissions on a file is chmod, which stands for "change
mode."
The proper syntax for the chmod command is:
chmod [-R] mode file...

The standard method for this is to use numeric codes that


identify the read, write and execute characteristics (modes).
These codes are as follows:

This numeric code: Is used for:

4 Read

2 Write

1 Execute

0 None

In order to generate the level of permission used, we add the


numeric codes above. The resulting three-digit code will
contain the owner's permission in the first digit, the group
permission in the second digit, and other in the third digit.
For example, the code 644 indicates that the owner has read
and write capability, while the group and other users only
have the ability to read.
The resulting file permissions would look like this for the file
named temp.txt:

Transcript

Changing There is a second method commonly used to change


permissions: permissions, and it is called the alphabetic method. You will
the alphabetic still use the chmod command, but with different style modes.
method In this method, the mode will be identified with a letter, as
opposed to numeric codes. The user is specified on the left
side of the expression, the level of access is specified on the
right, and a plus (+) or minus (-) is used in between to
designate the action of granting or removing access. The
following tables describe the characters that are legal for the
chmod command.

The following table shows which characters to use when you


are selecting the user for whom access is being set:

The user for whom access is identified in the command by the


is being set... letter...

Owner u

Group g

Other o

All users a

The following table shows which characters to use when you


are selecting the level of access that is being specified:

The level of access... is specified by the letter...

Read r

Write w

Execute x
An example of the command to grant write access to the file
named .bash_profile for the owner's group is:

chmod g+w .bash_profile

Next lesson In the next lesson, you will learn how security is managed in
Linux.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice changing permissions of a preexisting set
of files and directories using numeric or simple commands.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux file access permissions
Example of permissions (Mouseover
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

How to use permissions in Linux


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which level of access indicates whether an application program can be run?
Please select the best answer.
A. Read
B. Execute
C. Write
D. Delete

2. Which category of user indicates global access to a file for all users on the
Linux system?
Please select the best answer.
A. Owner
B. Group
C. Other
D. Root

3. In the following example, which category of user has no permission to access


the file in question: - rw- r-- ---
Please select the best answer.
A. Other
B. Owner
C. Group
D. Root
4. If the permissions were set to r-x for a particular file, which type of access is
not granted?
Please select the best answer.
A. Write
B. Read
C. Execute
D. Run

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux file security overview
Describe how security is managed in Linux.

Linux is a multi-user system that uses file and directory


permissions as the primary method to control user access to
files. Because more than one person can access the Linux
system, it is important to make sure your sensitive files aren't
available for other users to view. When you create a file, you
are assigned ownership and must therefore verify that
improper access has not been granted to other users. To do
this, use the ls -l command to produce a long listing of
file attributes, checking that only access which is intended
has been granted. The superuser (root) has unlimited access
to all the files on the Linux system. Ordinarily, only the root
user can access the files in the /root directory, but this can
be modified, as with any file or directory, using the chmod
command. To maintain a reliable measure of security, the
root account should only be used when performing system
administration tasks. All other activities should be concluded
using normal user accounts.

The following FlipBook illustrates what directories are


commonly accessible by the root user versus normal users.

Transcript

Next lesson In the next lesson, you will learn how to set default file
permissions.

Exercise
Before moving on to the next lesson, click the Exercise
button to test your knowledge of permissions commands.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Changing permissions from the command line
Using numeric values and changing
permissions (Simulation transcript)
1. The current permissions for the file named 'temp.txt'
indicate read and write by owner only. View the
permissions by typing "ls -l temp.txt"
2. We will now change the permissions so that the group
has read access. To do this we use the command
"chmod 640 temp.txt."
3. The resulting list of permissions shows read and write
permission for the owner, and now read permission for
group. View this with the command "ls -l temp.txt"
4. Now, we will add read permission for other users
using the chmod command again. Type "chmod 644
temp.txt" to change the permissions.
5. View the access level by typing "ls -l temp.txt" again.

6. Now we see a new "r" for read permission. This


completes the Simulation. Click the Exit button.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Changing permissions from the command line


Lab: numeric and simple commands
Objective
Change files and directories using numeric or simple commands.
Scoring
This exercise is worth a total of 5 points. To receive full credit, you'll need to cut and paste your answer
into the text box and click the OK, I'm Done button in order to submit it to a tutor.
Background
Enter the course lab to do this exercise.
Instructions
You will log into the lab system and change the permissions on five different files. The files will be
named file1.txt through file5.txt and will be in your home directory. You can use chmod
with either the numeric or alphabetic method, but you must produce the correct results for whichever
method you choose to the tutor.

Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted with
a password: prompt. Enter your password here. You should now see the shell prompt like this:

username@redhat $

Step 2: Change the permissions on file1.txt so that only the owner has read, write, and execute
access.
Step 3: Change the permissions on file2.txt so that owner has read and write, and group only has
read access.
Step 4: Set the permissions for file3.txt to read and write for owner, group, and other.
Step 5: Change permissions on file4.txt so only the owner has read and write access, but other has
read access.
Step 6: Set the permissions on file5.txt to read for owner; read, write, and execute for group; and
read and write for other.
Submitting your exercise
Enter your answer into the text box below. Click the OK, I'm Done button to submit your solution to a
tutor.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Changing permissions with GMC
Demonstrate how to change permissions with
GMC.

File access permissions can also be changed within the


GNOME Midnight Commander (GMC). It works by using a
variation of the numeric method for changing permissions.
You are able to view the numeric codes for the level of
access, but you can select individual check boxes for each
category of user. While this makes it slightly easier to make
changes to file access permissions, it will not eliminate the
need to use the chmod command since you will be spending
a good portion of your time on the command line.

The following FlipBook will walk you through the steps


involved in using GMC to change permissions.

Transcript

Next lesson The next lesson wraps-up this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Linux file security overview
Linux file security (FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Linux file security overview


Permissions
Objective
Determine the correct command for the desired result.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five objectives, and the corresponding commands required to meet those
objectives in the right column. Click once on an objective in the left column, then click once on the
command in the right column to make a match.
When you think you have all of the items matched correctly, click the Done button. Green lines mean the
match is correct, red lines mean the match is incorrect. If you didn't get the matches right the first time,
click Clear to erase your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

As you can see, file access permissions will be used quite


often to manage the level of access you wish to grant to other
users on the Linux system. In order to guarantee a reasonable
measure of security, you should attempt to limit the levels of
access you set on most of your files.
Now that you have completed this module, you should be
able to:
● Define file access permissions

● Describe how to change permissions in Linux

● Describe how security is managed in Linux

● Demonstrate how to change permissions with GMC

New terms Here are some of the new terms you encountered in this
module.
● Chmod

● Execute access
● Permissions
● Read access

● Write access

Coming up In the next module, you will learn how to use the Pico text
editor.

Quiz
Before moving on to the next lesson, click the Quiz button to
review what we have covered in this module.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Changing permissions with GMC
Changing permissions with GMC
(FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Using the pico text editor
Module introduction
Linux comes with a variety of text editors by default. The
most popular among these are pico, vi, and Emacs. Many
configuration issues are best handled by editing text files.
For this reason, regardless of which of these editors you
decide you like best, it is important to be able to use at least
one text editor under Linux. In this module, you'll learn to
use the pico text editor to manipulate text files.
By the end of this module, you will be able to:
● List the features of pico text editor

● Launch pico from the command line

● Edit a document

● Use pico's cut, copy, and paste features

● Quit and save a document

● Use the help feature in pico

Next lesson Most people choose an editor because they are comfortable
with the user interface. In the next lesson, you'll learn about
the features of the pico text editor.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Review of file access permissions


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which category of users has the ability to change the access permissions on a
particular file?
Please select the best answer.
A. The group
B. The owner
C. Other (all users)
D. The guest account

2. The following command: chmod 764 will grant execute permission to what
user category?
Please select the best answer.
A. Owner
B. Other
C. Group
D. Root

3. What option can the chmod command accept to indicate every user category
using the alphabetic method?
Please select the best answer.
A. a
B. u
C. g
D. o
4. In the GMC, mode 666 indicates what level of permission?
Please select the best answer.
A. Read, write and execute for all three user categories
B. Read and execute for all three categories
C. Write and execute for all three categories
D. Read and write for all three categories

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduce the pico text editor
List the features of pico text editor.

A text editor allows you to work with text documents, but


unlike a word processor, a text editor provides very limited
formatting capabilities.

You may be wondering how--or why--you might use a text


editor when you have a word processor available. The reason
is this: Linux system files are text files. Word processors add
formatting codes to the document as a way of tracking
formatting changes. Because Linux system files are text files,
these formatting codes are unexpected, and cannot be
interpreted by the shell. This can cause confusion when the
system later consults the file and finds the offending
characters. Text editors provide a way around this problem.

Features of Pico is designed to be a simple, easy-to-use text editor.


pico Although pico is a command line tool, you can access it from
either the command line or in a virtual terminal within X
Windows. You will learn how to do both in the next lesson.

Pico also has extensive help features to help you keep track
of the commands that are available to you.

The advantage You may be surprised to learn that pico is strictly a keyboard
of pico text editor, and does not use a mouse. Although this appears
at first to be a disadvantage, it is actually a tremendous
advantage. A graphical editor uses a significant amount of
processing resources. If for some reason X Windows
malfunctions, or you do not wish to use already strained
resources, you will always be able to use pico.

Next lesson Next, you'll learn to launch pico from the command line.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Launching pico
Launch pico from the command line.

Launching
pico
Launching pico is easy. From the command line, you use
the syntax below:

pico [filename]

Remember to separate the command and the filename with a


space.

This file can be either something that already exists, or the


new file that you want to create. As you'll see in the
screenshot below, the major pico commands are listed at the
bottom of the screen. For example, you will see that you exit
pico by entering Ctrl-X.
If you plan to do a lot of work in GNOME, you will need to
know how to open pico in the GUI.

Choosing the As mentioned earlier, pico requires that you supply a


filename filename as an argument. If you do not supply pico with a
filename, it will start--but with an empty work buffer. A
work buffer is the "workspace" the text editor uses before
content is saved to a particular file. Pico will request a
filename the first time you save the work buffer.

Let's try it using the QuickCheck below!

You can use pico to open existing system files by typing:

pico /etc/profile

The screenshot below shows /etc/profile open in pico,


which was opened using the pico [filename] method.
There are many system files that are text files, but many are
accessible only to root. This is a security feature. When you try to
access these files as a Red Hat® user, you will be told you do not
have permission to open them.

Next lesson For most people learning Linux, editing a document is the
most challenging task. You'll learn how to do this in the next
lesson.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Editing a document
Edit a document.

If you just wanted to view a document's contents, you would


use a program like more, less, or cat rather than actually
opening the file in an editor. You use a program like pico
when you want to actually alter the file in question.

Editing a There are many useful editing commands available in pico.


document One of the most important things to remember is that the
cursor needs to be placed at the location where you wish to
edit the text before you can begin editing. You move the
cursor by using the arrow keys on your keyboard. There are
also special key combinations that you will learn in a
moment.

Basic To delete text, as with most other text editors, use either the
keystroke Backspace or Delete keys.
commands
Although the pico help menu is located on the screen, we've
provided a list of some of the more useful commands in the
table below.

Pico commands using the Ctrl key are not case-sensitive. You may
see commands throughout this module in both, lower and upper
case.
Pico commands quick reference table

In order to: Type:

Move forward one character Right arrow —>

Move backwards one character Left arrow <—

Start text string search Ctrl-w

Move to next line Down arrow

Move to start of current line Ctrl-a

Justify text Ctrl-j

Save (write out) Ctrl-o

Move up one page, including help screens Ctrl-v

Exit Pico Ctrl-x

Move down one page, including help screens Ctrl-y

For a printable version of the above pico commands quick


reference table, click the Easy Reference folder icon.

Next lesson The cut, copy, and paste features available in other editors
are also available in pico. In the next lesson, you'll learn
about these features.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Launching pico
Opening pico in GNOME
When you are in GNOME, you have access to all of your
command line tools. All you have to do is open a virtual
terminal, which is a window that gives you a command line
prompt.

Launching 1. Launch the virtual terminal from menu bar at the


pico from bottom of the GNOME screen by clicking on the
within GNOME computer screen icon. This icon is shown below.

2. The screenshot of a virtual terminal is shown below.


3. Launch pico in the terminal window the same way you
would on the command line: type pico filename

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Cutting, copying, and pasting using
pico
Use pico's cut, copy, and paste features.

Cutting,
copying, and
There are some pointers to keep in mind when using the cut,
pasting copy, and paste features in pico. Before you can cut or copy
text, you need to first highlight it.
Once the text is highlighted, regardless of whether you want
to copy or cut and paste, you then need to cut the highlighted
or marked text.
If you want to copy text rather than cut it out, just paste it
right back into place. Otherwise, move the cursor to where
you want to put the new copy and paste (again).

Let's first take a look at the steps, then you'll complete an


exercise with an example.

Steps to cut, Whether you are using cut, copy, or paste you should begin
copy, and as follows:
paste
Action Steps to cut, copy, and paste

Highlight Position the cursor at beginning of the text you want to


highlight. Enter Ctrl-6 (The [Mark Set] character should
appear near the bottom of the window). Move the cursor to
highlight the text; the highlight should expand over the text as
you move the cursor.

Cut Once the cursor is positioned, enter Ctrl-K to delete the


text.

Paste Position the cursor in the new location where the text is to be
pasted and enter Ctrl-U.
Copy You have to cut and paste to copy text. Once the cursor is
positioned, enter Ctrl-K to cut the text. Then, enter Ctrl-U
to put it back. Now, you can move the cursor anywhere
within the document and paste in a copy by entering
Ctrl-U.

The paste command pastes whatever is in the buffer. As long as no


new text has been cut, you can repeat the paste as many times as
required.

Using the editing features in pico is fairly simple. As before,


the commands we've discussed so far are described in the
pico commands quick reference table provided in the Easy
Reference below.

For a printable version of the pico commands quick reference


table, click the Easy Reference folder icon.

Next lesson Once you've created a document, you need to save and quit.
You'll learn how in the next lesson.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a lab on using the edit, copy, and paste
features in pico.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Saving and quitting
Save and quit a document.

Almost everyone has learned that saving your document


regularly as you work is good policy. In addition, if you are
working on multiple documents at the same time, you will at
times need to close one file and continue with another.

Saving your You save the current document by entering Ctrl-o. This
work using brings up the following text on the bottom of your screen:
Ctrl-O

File Name to write:

If you have supplied a filename, it will automatically be


displayed. If you wish to save the file under another name,
this is your opportunity to change it. Simply use the
Backspace or Delete key to delete the listed filename, and
enter another.

Once you have correctly entered the filename, press Enter to


save the file.

If you do not want to save the file to the directory you ran pico
from, enter the full path of the directory you wish to save to and
the filename while saving.
Quitting pico The Ctrl-x command quits pico. When you quit pico, you
using Ctrl-X will also be prompted to save the file if you have made any
changes since your last save. If you answer yes, you will be
presented with a filename, just as you would with Ctrl-o.
Again, you can change the filename if you wish. If there
have been no changes made to the work buffer, you will not
be prompted for a new filename and pico will simply exit.

Using the editing features in pico is fairly simple. As before,


the commands we've discussed so far are described in the
pico commands quick reference provided in the Easy
Reference below.

For a printable version of the pico commands quick reference


table, click the Easy Reference folder icon.

Next lesson You'll learn about pico's help feature in the next lesson.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a lab on applying what you have learned
about Pico in this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Cutting, copying, and pasting using pico


Lab: using the edit, copy, and paste features in pico
Objective
Use the edit, copy, and paste features in pico.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
This lab provides you an opportunity to practice what you learned in the previous lesson. We'll start by
launching pico.
Instructions

Step 1: Launch pico: From the command line, type the syntax below. Remember to separate the
command and the filename with a space.

pico picotest

This will open a new file called picotest

Step 2:Insert text: Type the following


Pico is a simple text editor that
displays a menu at the bottom so I
won't forget a command. There are
other text editors available in Linux
as well, such as vi and Emacs.[Enter]
[Enter] If I needed to do a lot of
formatting, for example, to format
characters as bold or italic, I would
use a word processor instead of a text
editor.

The text should appear on the screen as you type it.


Step 3: Move to the beginning of the text you want to select: You need to highlight the text you are
going to use for the cut, copy, and paste operations. First, use the arrow keys to move your cursor to the
beginning of the second sentence, which begins with "There are."
Step 4: Begin highlighting: To start the highlighting operation, enter Ctrl-6
The text [Mark set] appears at the bottom of the screen.
Step 5: Select the area to work with: You now need to complete the highlighting operation. Move the
cursor using the arrow keys to the end of the sentence, right after the period. The entire sentence should
now be highlighted.
Step 6: Cut the text out of the document: Enter Ctrl-K to cut the text into the buffer.
The highlighted text is removed, and the remaining text reformats to fill in the space.
Step 7: Paste the text back in: You want to copy this line into multiple places without losing the
original. Without moving the cursor, press Ctrl-U to copy the text right back where it was.
Step 8: Move to the end of the document: Use the arrow keys to move to the end of the document.
Step 9: Add two copies at the end: Paste two copies of the text that's in your buffer at the end of the
document. To do this, press Ctrl-U, go to the end of the document again, and press Ctrl-U once
again.

If you have questions about this lab, please contact a tutor.

Lab HOWTO
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Getting help in pico
Use the help feature in pico.

There are many different commands available in pico, and


we cannot hope to cover them all here. However, over time
you might want to investigate the other commands available
to you. You can do this by using pico's help feature.

Getting help After starting pico, enter Ctrl-g to pull up the pico help
screen. The movement commands for this section are as
follows:
● Scroll down through the help screens with Ctrl-v
(page down)
● Scroll up through the help screens with Ctrl-y
(page up)
● Exit the help screens with Ctrl-x (quit)

You've learned how to use several commands in this module.


As before, each is described in the pico commands quick
reference provided in the Easy Reference below.

For a printable version of the pico commands quick reference


table, click the Easy Reference folder icon.

As always, you can also use the man or info commands to


pull up help pages for pico.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete a lab on using the help feature in pico.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Saving and quitting


Lab: using cut, copy, paste, quit, and save in pico
Objective
Use cut, copy, paste, quit, and save in pico.
Try editing a document using the new keystrokes you learned in the previous lesson.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.

Instructions
Step 1: Launch pico: Open the file picotest2 by typing:

pico picotest2

Step 2: Insert text: Type the following text, then add some of your own. It is important to save my work
regularly. Even though Linux is a very stable operating system, there can still be problems such as power
outages or someone tripping over the power cord that could cause me to lose everything I did up until the
last point I saved my data.
Step 3: Cut text: Move your cursor to the beginning of the file to the words "It is." Press Ctrl-6 to
start the highlighting, then move the cursor to right after the period at the end of the sentence. Now, cut
the text into the buffer by pressing Ctrl-K.
Step 4: Paste text: Move the cursor to the end of the file and press Enter so you are on a new line. Then,
press Ctrl-U to paste the text at this location.
Step 5: Save file: Press Ctrl-O to open the File Name to write dialog. Press Enter to save the file with
the currently assigned name.

Step 6: Quit and rename file: Go to the end of the document and press the spacebar. Now, press
Ctrl-X to quit the file. Since you made a change in the document, pico asks you if you want to save
the modified contents. Press y. Then, you get the File Name to Write dialog. Delete the current filename,
and type the following:

picotestnew

Step 7: Save your work: Now, press Enter to close and save the file.

If you have questions about this lab, please contact a tutor.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

You are now familiar with one of the many text editors
available in Linux. This allows you to go ahead and start
creating documents either in the lab, or on your home Linux
machine.
You should now be able to:
● List the features of pico text editor

● Launch pico from the command line

● Edit a document

● Use the cut, copy, and paste features

● Quit and save a document

● Use the help feature in pico

New terms Here is a list of terms used in this module that may have been
new to you:
● argument

● Emacs

● vi

Coming up In the next module, you'll learn about working with the shell
environment.

Quiz
Before moving on to the next module, click the Quiz button
to check your understanding of the concepts and procedures
taught in this module.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

The next lesson wraps up this module.


Lab: using the help feature in pico
Objective
Use the pico help feature to launch spellcheck.
Now it's time to use the help feature.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
This lab provides you an opportunity to practice what you learned in the previous lesson. We'll start as
usual by launching pico.
Instructions

Step 1: Create the file: Type the following to open the file you need to work with:

pico labfile

Step 2: Enter the text: Type the following sentence, exactly as you see it:

The quik brown fox jumped over the


lazy dogg.

Step 3: Open help: Open the help feature by pressing Ctrl-G.


Step 4: Find the spelling checker: Read the contents of the help section. Press Ctrl-V whenever you
cannot move down anymore. You are looking for the key combination that starts the spellchecker.
Step 5: Exit help: Once you find the key combination, press Ctrl-X to return to the file.
Step 6: Spellcheck the document: Press the key combination to spellcheck your document. Correct the
spelling of quik by replacing it with quick, and replacing the word dogg with dog.
Step 7: Save and exit the document: Press Ctrl-X to quit pico. Press y when asked if you want to
save the buffer contents, and then press Enter to use the same filename as before.

If you have questions about this lab, please contact a tutor.

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The shell as a working environment
Module introduction
The shell is the simplest form of user interface, the
command line interface. It acts as an intermediary between
the user and the kernel by accepting keystrokes from an input
device (your keyboard), sending the correct command to the
kernel, and then sending the output to a device that allows
you to see it (your monitor screen). The shell is an attempt to
make interaction with the system user-friendly by creating a
natural language interface. In this module, we will deal
primarily with the default Linux shell, called the bash shell.
By the end of this unit, you will know how to:
● Describe the shell and what it does

● List the available shells in Linux and the features and


advantages of each
● List the features of the bash shell

● Describe the use of shell variables and demonstrate


how to view them
● Quote items on the command line to prevent special
characters from being interpreted

● Recall previous commands using the history


command

Next lesson In the next lesson, you will learn what the shell is and the
functions it performs.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Module review
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. What would you type in order to open the file mytext for editing in pico?
Please select the best answer.
A. pico > mytext
B. mytext pico
C. pico
D. pico mytext

2. Which two of the following keystrokes allow (whether immediately or as part


of a larger process) you to save your work in pico?
Please select all the correct answers.
A. Ctrl-O
B. Ctrl-X
C. Ctrl-S
D. Ctrl-W

3. What do you type in pico to access the help feature?


Please select the best answer.
A. Ctrl-?
B. Ctrl-H
C. Ctrl-G
D. Ctrl-F
4. What pico command do you use to start highlighting text for a cut
operation?
Please select the best answer.
A. Ctrl-6
B. Ctrl-C
C. Ctrl-V
D. Ctrl-X

5. What pico command would you use to cut out the text you just highlighted?
Please select the best answer.
A. Ctrl-Y
B. Ctrl-X
C. Ctrl-C
D. Ctrl-K

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
What is the shell?
Describe the shell and what it does.

A shell is a program that users interact with to send


commands to the kernel, which interfaces directly with
hardware devices (such as a hard disk drive). The shell takes
user input (most commonly through a keyboard), interprets
commands, and forwards the instructions to the kernel. The
shell then accepts data from the kernel after execution of the
command, and sends the output to a device, usually the
screen. Therefore, the function of the shell is to buffer the
user from the hardware itself, preventing errors that could be
caused by invalid commands.
The shell primarily handles command interpretation and
maintains the environment. You can think of command
interpretation as a three-step process:
1. When a user hits the Return key after entering a
command, the shell first breaks the pieces up into
"words" (not words from any language that we would
recognize, but units that have special meaning to the
shell).
2. The shell then determines which words are commands
and which are arguments used by the command.
3. Lastly, the shell locates the command to be executed,
and does so with the arguments specified.
The Linux user environment is highly customizable, and the
shell provides this functionality. There are three main items
used to customize the shell environment: aliases, options,
and variables.
An alias is a shell-defined command used to reference
another command on the system. In effect, you can actually
abbreviate or shorten a particularly complex command by
creating an alias for it. Options are settings that alter the
behavior of the shell. For example, you can set your
preferred text editor using shell options. Shell and
environment variables are names that have a value of some
sort associated with them. This value can be anything really;
variables are used to customize your command prompt, and
even to show you who the current user is.

The following FlipBook walks you through the shell's


functionality.

Transcript

Next lesson In the next lesson, you will learn the advantages of each type
of shell in Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Available shells in Linux
List the available shells in Linux and the features
and advantages of each.

An assortment of shells can be used in Linux. It is entirely


up to you, the user, to determine which type of shell you
prefer to use. This lesson discusses the following shells:
● Bourne shell

● C shell

● TC shell

● Korn shell

● Bourne again shell

The original UNIX shell was the Bourne shell (abbreviated


as sh). It is still in wide use today, primarily because of its
portability as a scripting language. The C shell (abbreviation
csh, also called the Berkeley shell), was used mainly on BSD
style UNIX systems, and included new features that Bourne
did not have. It has since been replaced by a descendant of
the C shell, the TC shell (abbreviation tcsh). The Korn shell
(abbreviation ksh) is based on the Bourne shell, but has
many enhancements to the command line editing feature.
Lastly, the Bourne again shell (abbreviation bash) was
derived from the Bourne shell, and also inherits many of its
features from the Korn shell. You will use this particular
shell quite a bit throughout this course. The bash shell is
identified by the dollar sign prompt ($).

The features that most influence your choice of shell are


shown in the following table. Each of these features has its
advantages:
Command line editing, a very useful utility, is supported by
all of the shells we have mentioned. There are other features
that these shells have in common as well. The following
table illustrates the features supported by each shell.

You should familiarize yourself with the shell name


abbreviations shown in the above table, since they will often
be referred to in this way within the Linux environment.

Next lesson In the next lesson, you will learn about the features of the
bash shell.

Exercise
Before moving on to the next lesson, click the Exercise
button to help familiarize yourself with the common
abbreviations for Linux shells.

Quiz
Before moving on to the next lesson, click the Quiz button to
review available shells.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
What is the shell?
The shell and what it does (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The bash shell
List the features of the bash shell.

The bash shell extends the functionality of both the Bourne


shell and the Korn shell by including all of their features and
adding additional ones.
As mentioned previously, bash is the standard shell used in
Red Hat® Linux, but it is also used in other UNIX systems.
Command line editing is one of the most important features
in shells today, and bash has one of the most advanced
command line editors available. Bash also uses wildcards
and special characters, which can greatly increase your
productivity.

You can customize your environment in bash with aliases,


environment variables, and options. Aliases are basically
command nicknames. You can use them to abbreviate the
longer commands you use frequently. Environment variables
are values assigned to a name that modify the behavior of the
shell or other programs. Shell options are settings that
control the behavior of the shell only. These can be changed
in the current session by setting them from the command
line, or you can use files that are provided for you. These
files allow you to set your environment at login time, as they
are automatically run each time you log in to the Linux
system. This, combined with the shell history feature, can
significantly decrease the time spent typing and re-typing
arcane commands.

Next lesson In the next lesson, you will learn about shell variables and
how they are used.

Exercise
Before moving to the next lesson, click the Exercise button
to review the most important features of the shells we have
discussed in this lesson.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Available shells in Linux
Command line editing
Although this may not seem like an enormous advantage, it
can be useful--especially if you are a new user and are
unfamiliar with the commands. When a shell does not allow
command line editing, it means that if you make a mistake
while typing in a command, you must go ahead and enter the
command anyway, because you are not allowed to backspace
and fix your mistake. You will simply have to wait until you
get another prompt, then try entering the command again.
Command line editing offers you the opportunity to fix an
error in a command or change your mind and use a
completely different command.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Available shells in Linux


Shells and their abbreviations
Objective
Match the full shell name with its abbreviation.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five shell names; their corresponding abbreviations are listed in the right
column. Click once on a term in the left column, then click once on the abbreviation in the right column
to make a match.
When you think you have everything matched correctly, click the Done button. Green lines mean the
match is correct, and red lines mean the match is incorrect. If you didn't get the matches right the first
time, click Clear to erase your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Available shells
Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. Which of the following was the original UNIX shell?
Please select the best answer.
A. Bourne again shell (bash)
B. Korn shell (ksh)
C. C shell (csh)
D. Bourne shell (sh)

2. Which two of the following shells are based primarily on the Bourne shell?
Please select all the correct answers.
A. bash
B. ksh
C. csh
D. tcsh

3. Which feature allows you to make changes to your command?


Please select the best answer.
A. Command completion
B. Filename completion
C. Filename expansion
D. Command line editing
4. Which one of the following things happens when you use either the command
completion feature or the filename completion feature?
Please select the best answer.
A. The shell adds extra command line arguments
B. The shell expands the wildcard you type
C. The shell types the remainder of the command
D. The shell searches for the command in your home directory

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Shell variables
Describe the use of shell variables and
demonstrate how to view them.

A shell variable is simply a name that has a value


associated with it. The value can represent everything from
how the shell prompt should look, to the home directory of
the current user. The shell defines many of these variables
automatically, but the user can add his or her own, or even
modify existing ones. These variables are used quite often to
customize certain characteristics in application programs you
might use, such as your email client.

Viewing shell You can access all of the variables in the bash shell by
variables adding a dollar sign ($) to the front of the variable name. The
shell interprets this as the value associated with the current
variable. One common shell variable is the executable path,
identified by the $PATH variable. This variable sets which
directories are searched when you type a command. By
default, this contains directories such as /usr/bin and
/sbin. You can view the value of the $PATH variable by
using the following command:

The echo command displays the value of $PATH; as you


can see, the result is a long string representing the directories
that will be searched when you type a command and hit the
Enter (or Return) key.

Next lesson In the next lesson, you will learn how to prevent the
interpretation of special characters.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The bash shell
Bash in UNIX
The Bourne again shell (bash) was developed for the GNU
project, and uses the GPL as its license. The bash shell
attempts to comply with POSIX standards, which is a
standards organization that is used for many Unix system
programs and properties. These standards are put in place to
prevent too much variation in system programs, for the
benefit of users primarily, but also for programmers. For
example, the Linux kernel is not entirely POSIX compliant,
but it is designed to conform to the majority of standards that
apply to an operating system.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
The bash shell
The shell history feature

The shell history feature allows you to view a list of


previously typed commands. The image above shows what
this list might look like on your screen. The list always
begins with the first command typed, and ends with the most
recent command. As you can see in the example above, the
last command that was used was ls-l.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

The bash shell


Review shell features
Objective
Match each shell feature with its description.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five terms; their corresponding definitions are listed in the right column.
Click once on a term in the left column, then click once on the definition in the right column to make a
match.
When you think you have all of the terms and their definitions matched correctly, click the Done
button--green lines mean the match is correct, red lines mean the match is incorrect. If you didn't get the
matches right the first time, click Clear to erase your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quoting special characters
Quote items on the command line to prevent the
interpretation of special characters.

Special characters convey a special meaning to the shell.


When you type in a command on the command line and the
shell interprets it, it replaces any special characters with the
literal value that they represent. An example of this is the
dollar sign ($) in the previous lesson; the shell is
programmed to interpret this character as a variable.
However, if instead of denoting a variable you really
intended to see the dollar sign in your output, you must
indicate this to the shell. This is known as "escaping the
character," or "quoting" because a set of quotation marks is
often used.
You can prevent the shell from interpreting the special
meaning of a character by using the single quotation mark
('), the double quotation mark (") or the backslash character
(\). The single quotation mark is known as the strong quote,
because it will always prevent any character inside from
being interpreted as special. The double quotation mark is
considered a "weak" quote, because some characters will still
be interpreted, such as the $, \, or ~. Also, the backslash
indicates to the shell that only the character immediately
following will be quoted; thus the backslash is known as the
single character quote.
Try using the special characters in the following Simulation.

Transcript
Next lesson In the next lesson, you'll learn how to recall commands from
the shell history.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice quoting special characters on the command
line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Recall and use previous commands
Recall previous commands using the history
command.

The shell history function allows the user to recall


commands that have already been issued. The history is
actually kept in a file that is added to each time a command
is executed. This file is kept in the user's home directory, and
is by default called .bash_history. This file is useful
because it keeps track of which commands have been run
between sessions, while other shells only record the history
for the current session.
You can recall commands by using the up arrow key; your
previous command simply appears on the command line. As
you continue to tap the up arrow, you cycle through the
commands you have typed, in order from most recent to
oldest. You can also use the down arrow key to go back
down the list if you have gone past the command you wanted
to execute. This feature is one that will save you quite a bit
of time, and is unfortunately quite habit forming.
There are other ways than the arrow keys to access your shell
history. You can type the history command, which will
show you every command stored in the history file, including
at which position it is located. You can type !!, or two
exclamation points in a row, to execute the very last
command automatically. Or, if you know the number of a
command to execute from the history file, you can type !n to
execute the command, where n is the command number.
Try accessing the shell history in the following Simulation.

Transcript

Next lesson The next lesson wraps up this module.


Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quoting special characters
Quoting special characters (Simulation
transcript)
1. First view the $SHELL environment variable by
typing the command: echo $SHELL.
2. Let's see how the shell interprets the dollar sign with
double quotes around the expression, by typing: echo
"$SHELL".
3. You see that the previous command was still
interpreted as a variable by the shell (the result was
exactly the same as before). Type echo '$SHELL', this
time using the single quotes, which should quote the
dollar sign correctly.
4. The single quotes have eliminated the dollar sign's
special meaning from the command. Last, type the
command: echo \$SHELL, and notice the behavior of
the dollar sign with the single character quote.

5. The results were the same as with single quotes; the


backslash character also prohibits the shell from
interpreting the dollar sign as a special character. This
completes the Simulation. Click the Exit button.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Quoting special characters


Lab: quoting special characters on the command line
Objective
Explore quoting special characters on the command line.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Instructions
Enter the lab environment. Let's try experimenting with quoting special characters by using the three
types of quote characters. We will use the echo command to show the PATH shell variable, and then
show what happens when we prevent the shell from interpreting it.
Step 1: You will be prompted with a login: prompt. Enter your username, then you'll be prompted with
a password: prompt. Enter your password here. You should now see the shell prompt like this:

Please show valid prompts here:

[redhat@localhost redhat]$

Step 2: First show the $PATH variable using the following command:

[redhat@localhost redhat]$ echo $PATH

Step 3: Try quoting the shell variable name with the double quotes:
[redhat@localhost redhat]$ echo
"$PATH"

Step 4: Now quote it using the single quotes (strong quotes):

[redhat@localhost redhat]$ echo


'$PATH'

Step 5: Last, try using the backslash in front of the dollar sign:

[redhat@localhost redhat]$ echo \$PATH

Lab HOWTO

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

In this module, you learned about the shell and its functions.
You then saw the shells that are available to you in Linux.
You explored shell variables and saw demonstrations on
viewing them. You also learned how to quote special
characters. Finally, you learned how to recall previous
commands using the history command.
After completing all of the lessons and their learning checks,
you should now be able to:
● Describe the shell and what it does

● List the available shells in Linux and the features and


advantages of each
● List the features of the bash shell

● Describe the use of shell variables and demonstrate


how to view them
● Quote items on the command line to prevent special
characters from being interpreted

● Recall previous commands using the history


command

New terms Here are some terms that may have been new to you in this
module:
● BSD style

● Command completion
● Command history
● Command line editing
● executable path
● Filename completion
● Filename expansion
● Kernel
● Natural language interface
● Shell

● Shell history

Coming up The next module in this series will teach you about printing,
file packaging, and miscellaneous commands.

Quiz
Before moving on to the next module, click the Quiz button
to review the concepts we have covered in this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Recall and use previous commands
Ways to use the history command
(Simulation transcript)
1. Use the up arrow key to recall the previous command
issued, and hit Enter to execute it again.
2. Type the word history. This will display all the
commands stored in the history file, with the most
recent command at the bottom of the list.
3. A shorter form of this command is to type two
exclamation points !! and then hit the Enter key. This
also executes the very last command issued,
automatically.
4. You can see that the history command is listed
twice--once for the time you typed in history and once
for the time you used exclamation points (!!). If you
want to run one of the commands in this list, you may
type exclamation point and the number of the
command; for example, typing !31 will execute the
command identified by the number 31 in the list. Type
!31 now to see how this works.

5. You can see you ran the cd command, which was


number 31 in the list. This completes the Simulation.
Click the Exit button.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing, file packaging, and
miscellaneous commands
Module introduction
Red Hat bundles a varied collection of tools and
applications with its base operating system. The selection
includes essential software such as text editors and Web
browsers and optional items like programming environments
and games. In this module, we will demonstrate the use of
some of the most common tools and explain why they will
undoubtedly come in handy.
After completing the lessons and learning checks in this
module, you will know how to:
● Use the print utility in Linux

● Explain PostScript and ghostscript

● Print from an application

● Use various print commands to print from the


command line
● Query a print queue and cancel a print job

● Use the mount command to access filesystems

● Access a DOS diskette

● Detail the reasons for archiving files

● Use file compression and file compression utilities

Next lesson In the next lesson, you will learn how the print utility works
in Linux.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Review: the shell as a working environment


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.

1. What are two of the shell's responsibilities?


Please select all the correct answers.
A. Command interpretation
B. Allowing the user to directly access hardware components
C. Maintaining the environment for the user
D. Forcing the use of the Emacs command line editor

2. Name the default Linux shell.


Please select the best answer.
A. Bourne again shell (bash)
B. Korn shell (ksh)
C. TC shell (tcsh)

3. A dollar sign indicates what shell feature?


Please select the best answer.
A. A command line editor
B. A quote character
C. The history command
D. A shell variable

4. In what file are the previous commands you typed kept?


Please select the best answer.
A. .bash_profile
B. .bash_history
C. .bash_logout
D. .my_history

5. You can recall the last command you typed by using what single key on the
keyboard?
Please select the best answer.
A. The Tab key
B. The backslash key (\)
C. The left arrow key
D. The up arrow key

6. What special character indicates the strong quote?


Please select the best answer.
A. The double quote ( " " )
B. The backslash ( \ )
C. The single quote ( ' ' )
D. The backtick (``)

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing in Linux
Describe how the print utility works in Linux.

Printing from your Linux system is very similar to printing


in other operating systems. The main difference is that with
Linux, it doesn't really matter if the printer is attached to
your computer or to another one on the network. You can
print to any printer in the network. This type of networking
can be done with some effort in other operating systems, but
it is especially simple in Linux; the Linux printing system
was designed from the ground up to be networked.
Printing is controlled by the line printer daemon (lpd). To
print using lpd, you must have a print queue for each printer
on your system; a queue must also exist for networked
printers, designated as a remote queue. Each print request is
spooled to the queue, and is printed in order of receipt. This
spooling service allows a job waiting in the queue to be
cancelled if necessary. A user has full control over the print
job he/she has submitted, but only the root user has control
over all jobs, as well as the ability to cancel or hold a job in
the queue indefinitely.

The following FlipBook outlines the use of the print facility


in Linux.

Transcript

Next lesson In the next lesson, you will learn about PostScript and
ghostscript.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing PostScript and ghostscript
data
Explain PostScript and ghostscript.

What is PostScript (PS) is a common printer control language


PostScript? originally developed by Adobe Systems. PostScript files can
be viewed on any operating system and printed on almost
any printer because the language is widely used. What makes
PostScript so popular is the relative ease with which a user
can create documents that look professionally typeset.

A PostScript file is plain text, which means it is possible to


read it with a text editor. In all likelihood, you wouldn't want
to do this, however, since the majority of the document is
filled with incomprehensible codes used in formatting. This
coded language, although difficult for you to read, is easily
interpreted by printers and PS file viewers and results in a
nicely formatted document.

What is Some printers don't understand the PostScript language. If


ghostscript? this is the case with your printer, you may still be able to
print these files. Ghostscript is a viewer that is similar to a
PostScript file viewer, but rather than showing the document
on the screen, it converts it to a graphics format that can be
understood by many non-PostScript printers. Ghostscript is
basically an interpreter of the PostScript language.
Ghostscript offers support for a large number of commonly
used printers that don't understand PostScript. You can go to
the Resources page to get the link for the ghostscript printer
compatibility list.

This FlipBook explains the use of ghostscript in printing


PostScript documents.

Transcript
Next lesson In the next lesson, you will learn how to print from an
application.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing in Linux
Print utility (FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing from applications
Print from an application.

Many applications used in the X Window System have the


ability to print. These applications use the Linux print utility,
and therefore can be queried or cancelled as with any print
job. These requests are submitted to the lpd process by the
application on behalf of the user. Depending on the
application being used, the output may be formatted as
PostScript. This is usually the case with non-text data. This
will be handled properly if your printer is a PostScript
printer, but if you do not own a PostScript printer, you will
need to use the ghostscript interpreter.

The gEdit text editor is one of the GNOME applications that


has an option to print directly to lpd. The following
FlipBook illustrates how to print using gEdit.

Transcript

Next lesson In the next lesson, you will learn to use various print
commands to print from the command line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing PostScript and ghostscript data
Postscript and ghostscript (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing from the command line
Use various print commands to print from the
command line.

You can print from the command line with the line printer
spooling command, lpr. This command sends a print
request to the line printer daemon, where it is queued to be
printed. The default print queue is /dev/lp, but you can
specify a different queue with the -P option. The syntax for
the lpr command is as follows:

lpr [options] [file...]

lpr can print one or more files from a single command, or it


can print the text given as standard input. Another common
option is -#number which prints the number of copies
specified by number. By default, the lpr command prints
a header page showing the user who submitted the print job.
This extra page can be suppressed by using the -h option.
Also, if you are printing a large file, use the -s option to
create a symbolic link to the file rather than copying it into
the spool directory. The command to print the file
file1.txt to the printer named lp1 is as follows:

[root@localhost/root]#lpr -P lp1
file1.txt

Next lesson In the next lesson, you will learn how to query a print queue
and cancel a print job.
Exercise
Before moving on to the next lesson, click the Exercise
button to review the commands necessary for printing from
the command line.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Printing from applications
Printing from an application (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Querying and canceling
Query a print queue and cancel a print job.

Querying a
print queue
The lpq command provides a mechanism of querying the
print spool for the status of print jobs currently in the queue.
Just like the lpr command, lpq contacts the line printer
daemon (lpd) to determine the jobs in a particular queue. It
then shows the list of jobs in the queue in the order they were
received by the daemon. The owner of the print job is listed,
indicating who submitted the request to the queue. The
following is the syntax for the lpq command:

lpq [options] [job#] [name]

The most common option used with lpq is -P, which


specifies the print queue to query.

Canceling The information obtained by the lpq command can be used


print jobs to remove a print job that is in the queue. The lprm
command will remove a job that has been spooled to the
queue. If the job is already in the process of printing, the
lprm command will cancel the job altogether. The syntax
of the lprm command is similar to the lpq command:

lprm [options] [job#...] [user]

The following table illustrates how a print job is canceled.


Click the thumbnail images on the left and they will open up
to full size. The explanations on the right describe each step
of the process.
You send a job to the default queue with the
command lpr file1.txt.

The lpq command queries the queue, and you see


your job is number 0 (zero).

To cancel the request, use the lprm 0 command, to


remove job number 0 from the queue.

You can query the queue again with the lpq


command. This time it shows no jobs in the queue.

The commands you have covered in this lesson are very


useful in controlling the print queues on your Linux system.
The following Simulation will help you to understand lpr,
lpq, and lprm even better by letting you practice what
you have just learned about querying and canceling print
jobs.

Transcript

Next lesson In the next lesson, you will learn how to use the mount
command to access filesystems.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Printing from the command line


Printing from the command line
Objective
Review the commands necessary to print from the command line.
This is a Java applet

This exercise uses a Java applet to allow you to match items in the left column with
the items in the right column. If you do not have Java active in your browser or are
behind a firewall that does not allow Java applets, you will not be able to complete
this exercise. If you do not see the applet below, click OK, I'm Done to continue
with the course. You will receive full credit for this exercise.

Instructions
In the left column below are five commands with their resulting output listed in the right column. Click
once on a term in the left column, then click once on the definition in the right column to make a match.
When you think you have all of the command and their results matched correctly, click the Done button.
Green lines mean the match is correct, and red lines mean the match is incorrect. If you didn't get the
matches right the first time, click Clear to erase your matches and try again.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Accessing filesystems from the
command line
Use the mount command to access filesystems.

Accessing
filesystems
Filesystems are hard disk partitions that contain user
using the directories and files. While they are always on your hard
mount disk, they may or may not be available to your Linux system.
command Each hard disk partition is a separate filesystem, and these
must be mounted in order to access the data contained on the
partition. There are many filesystems that are mounted by
default when the system boots, for example, your root
filesystem (/) and the /home filesystem (if separate). You
can also mount network drives, either at boot time or
afterwards. Typically, CD-ROM and floppy drives are not
mounted at startup.
To mount a filesystem from the GNOME panel, select:
System/Disk Management. This utility gives the user
the ability to view the filesystems available and mount or
unmount them. Note that it may be possible to format the
filesystem from this utility as well. The /etc/fstab file
contains a list of all the filesystems on the system, and
indicates the mountpoint that will be used when mounting
the filesystem.
The following MouseOver illustrates the user mount tool.
Transcript

Accessing Filesystems can also be mounted or unmounted from the


filesystems command line. The mount and umount commands are
from the used for this purpose. Again, the /etc/fstab file can be
command line used to determine the mountpoint to use in the command.
The syntax for both commands is shown below:

mount [-a] [-o options] [mountpoint] umount


mountpoint

The -a option will mount all available filesystems as


specified in the /etc/fstab file. Otherwise, the mount
command will only work on the given mountpoint.

Next lesson In the next lesson, you will learn how to access a DOS
diskette.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Querying and canceling
Querying and canceling (Simulation
transcript)
1. Spool a print job using the command lpr -h myfile.txt.
2. Now use the lpq command to query the status of the
print job.
3. Use the lprm command to remove your job from the
queue. Remember to follow this command with the
identifying number of your print job. If there were
other jobs in the print queue, submitted by other users,
you would not be able to remove them; you never have
the ability to remove jobs submitted by other users.
4. After removing the job from the queue, use the lpq
command again to verify that your job has actually
been canceled.

5. We see "no entries" in the print queue, so we know


that the print job has been successfully canceled. This
completes the Simulation. Click the Exit button.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Accessing DOS diskettes
Access a DOS diskette.

The mtools suite of utilities is used to easily access


DOS-formatted diskettes. The floppy drive does not need to
be mounted before running the mtools command; in fact, it
should not be mounted or the command will fail. The syntax
for these commands is similar to the DOS equivalents,
except for the preceding letter "m." The three main
commands you will use are mdir, mcopy, and mmove. The
drive letter is used as in DOS, so the primary floppy drive is
accessed as a: and the secondary as b:.
Use the mdir command to list the contents of the DOS
floppy.

Use the mcopy command to copy a file from your system


to the DOS floppy.
Next lesson In the next lesson, you will learn the reasons for archiving
files.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Accessing filesystems from the command line
Using the Mount command (Mouseover
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Why archive files?
Detail the reasons for archiving files.

Archiving is a method of collecting many files, possibly


from different directories, into one target file. This makes it
easier to backup, store, and transfer the list of files;
compression can also be employed to reduce the amount of
space used. These archives can be kept on the hard drive, put
on a floppy for safe keeping (if the archive is smaller than
1.4MB), or put on another type of media for long-term
storage.
The tar command is typically used to archive files and
directories. tar was originally developed to archive files
onto tape, and actually stands for Tape Archiver. While you
may not find yourself creating archives from your own files,
software packages are often distributed in archives.
Therefore, you will be using the tar command quite
frequently to unpack software onto your system.
The table describes many of the situations where you might
use an archive.

Creating an You create an archive with tar using the following syntax:
archive

tar cvf archive_name files...

The option c creates a new archive, v produces verbose


messages, and f indicates the name of the file to be created.
Note that the options do not need a leading hyphen, but it
may be included. As the archive is being created, tar prints
out the name of the file it is adding to the archive (because of
the verbose option). This is helpful in determining how far
along the command has progressed, especially when adding
very large files.
Click through the following FlipBook to learn more about
the tar command.

Transcript
Discussion
Please consider going to the discussion area to comment on
your experience using archives in Linux or other operating
systems. There are quite a few methods, and even more
reasons for using archive tools. We'd like to hear what you've
used in the past.

Next lesson In the next lesson, you'll learn how to inspect archives and
extract information from them.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Working with archives
Demonstrate how to inspect and extract from
archives.

Inspecting an
archive
If you have an archive file, how do you tell what has been
archived inside it? The tar command provides for this with
the list option. The syntax for listing the contents of an
archive are as follows:

tar tf archive_name
tar tvf archive_name

The first command displays a basic list of all files in the


archive. The second command uses the v (verbose) option,
and causes a long listing to be displayed, showing file size,
owner, and time stamp.

Extracting Once you have determined what is in an archive with the list
from an option, you'll probably want to extract the files from the
archive archive. You can do this using the x option, for extract. The
syntax is:

tar xf archive_name

The archive will be extracted in the current directory. If you


do not want to place the files from the archive into your
current directory, you can use the change directory option to
tar, which is -C. This causes your command to change to
the target directory only for the purposes of extracting the
archive. When the extract is complete, you will return to the
directory from which you started the command.
Also, the files extracted from the archive maintain their
hierarchy relative to the current directory. This means if they
were originally archived in a directory called tmp, the tmp
directory will be created in your current directory, and all the
files from the archive will be placed in that location.

Next lesson In the next lesson, you will learn how to use file compression
and file compression utilities.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Why archive files?
Tar (FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File compression
Use file compression and file compression utilities.

Why use file


compression?
File compression is used primarily to reduce the amount of
space occupied by files on your system. If you have files that
you don't use often, you should be able to compress them
and, in effect, create more usable space on your hard disk.

You can compress any type of file, but the space reduction
varies depending on the file type. Text files may be
compressed up to 75 percent or more, while binary files will
not produce such an extreme reduction in size. You'll often
see tar archives compressed, since the archive is often
times sent somewhere on the network or placed on floppy
disk. This minimizes the amount of time it takes to move the
archive.

Compression The standard UNIX compression utility is compress. Its


utilities reverse utility is the uncompress command, used to
restore the files to their original size. When creating
compressed files with this utility, the original is replaced, and
the extension .Z is added to the new file. This compression
method can compress text files up to 50 percent.
Uncompress reverses this process by removing the file
extension .Z, and replacing the file altogether.

The following FlipBook illustrates the use of file


compression.

Transcript

Next lesson In the next lesson, you will learn about gzip and archive
compression.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Gzip and archive compression
Describe how to use gzip and list the reasons for
compressing archives.

Using gzip
The standard Linux compression utility is gzip, and it has
the gunzip command that reverses the compression. gzip
adds the .gz extension to a compressed file. This utility
will compress text files up to 75 percent, reducing the space
used by quite a bit more than the compress command.
The syntax for both the gzip and gunzip commands is
as follows:

gzip [-d] file...


gunzip file...

To compress a file named myfile.txt with the gzip


utility, we use the following command:

gzip myfile.txt

This produces the resulting file named myfile.txt.gz.


The FlipBook further demonstrates the use of these
compression utilities.

Transcript
Compressing tar can compress files it is adding to an archive using
archives gzip or compress with the use of a single option on
the tar command line. For gzip the option is z, and for
compress it is Z. Using these options forces the input files
through the gzip or compress command before creating
the archive. This works for both creation and extraction of
files.

An example of two compressed archive commands are


below:

tar czvf archivename files...


tar cZvf archivename files...

Reasons for compressing archives

To free up disk space

So the files in the archive can be transported more quickly and easily

To distribute a group of files from an FTP or Web site

For long-term storage

Next lesson The next lesson wraps up this module.

Exercise
Before moving on to the next lesson, click the Exercise
button to practice what you've learned in this lesson in the
lab environment.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
File compression
Using file compression and file
compression utilities (FlipBook
transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Module wrap-up

In this module, you learned about the print utility in Linux


and practiced using it in the lab environment. You also
learned about the importance of archiving files. Now that
you have completed all of the lessons and learning checks in
this module, you should know how to:
● Use the print utility in Linux

● Explain PostScript and ghostscript

● Print from an application

● Use various print commands to print from the


command line
● Query a print queue and cancel a print job

● Use the mount command to access filesystems

● Access a DOS diskette

● Detail the reasons for archiving files

● Use file compression and file compression utilities

New terms Here are some terms that may have been new to you in this
module:
● gEdit

● ghostscript
● line printer daemon
● PostScript
● print queue

● printer daemon

Coming up The next module wraps up this course and gives you the
opportunity to practice what you've learned by completing a
case study.
Quiz
Before moving on to the next module, click the Quiz button
to review the concepts you have learned in this module.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Gzip and archive compression
How to use gzip (FlipBook transcript)
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Gzip and archive compression


Lab: file compression and file compression utilities
Objective
Create an archive containing three text files, and compress it using gzip.
Now it's time to try what you have learned in a real Linux system setting.
Scoring
This non-scored lab provides you an opportunity to practice what you learned in the previous lesson in
the actual Red Hat® Linux environment. You will be presented with a task, but will not submit your
response to a tutor. When you have completed the exercise, click the OK, I'm Done button to continue.
Background
Enter the course lab to do this exercise.
Instructions
Step 1: In your home directory, you should have at least three text files for use in this exercise. You may
choose any three files.
Step 2: Create an archive of the three files using the tar command with the correct options. Please
name the archive lesson11.tar. You may use the gzip flag on the tar command if you want.
Step 3: If you did not use the gzip flag on the tar command in the last step, use the gzip
command to compress the archive created above.

Step 4: You will not be able to send this file to your tutor; instead make sure the final file is named
lesson11.tar.gz. If you have questions, send a note to your tutor, and explain that the compressed
file is in your home directory.

Lab HOWTO
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course project
Module introduction
You are only one step away from completing the course!
We have designed a case study to provide a final opportunity
for you to apply some of what you have learned.
In this module, you will complete a series of exercises in
which you respond to scenarios and troubleshoot various
problems that occur.
Within each exercise, we provide various resources, such as
a hardware inventory, email, online resources, planning tools
and an installation checklist, which will help you with each
task. You can access these items from a case file that looks
like this. Click the Case Files icon now:

Planning your As you now know, while every install is going to be


installation different, there is a certain process you should follow before
getting started. This approach will make the installation itself
a lot easier.
Before you begin the first exercise, consider the following.
1. Why are you installing Linux?
2. What is this machine's primary job?
3. What is this machine's secondary job, if any?
4. How many users do you think will need access to this
machine?

5. What software packages are you planning on installing


on this machine?
If you wish to skip the case study and corresponding review, go to
Lesson 4.

Your role As anyone who has installed Linux will tell you, a successful
installation is no small feat for the beginner. Even if you've
been working with Linux for some time, a simple install
takes some time to plan.
In this module, you'll prepare for and complete a simulated
install of Linux. You will also complete an exercise in simple
filesystem navigation and comprehension. In completing the
course project, you must examine and coalesce the available
information.
In the first exercise, you'll work with information about your
hardware, consult the "online documentation" provided, and
review other sources of information to plan and execute a
successful installation.
In the second exercise, you'll be asked to troubleshoot a
problem regarding permissions, and will be assigned a list of
discrete tasks to resolve it.
After completing the two case-study exercises in this
module, you will have demonstrated your ability to:
● Determine the best partitioning scheme based on a
given scenario
● Partition Linux during the install of a GNOME
workstation dual-boot system using the Disk Druid
partitioning tool
● Describe hardware compatibility issues

● Navigate the Linux filesystem

● Change permissions using the chmod command

● Create a directory

● Use soft links to make a shortcut to a file

What's next? Next, you will begin the first exercise in the case study.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Quiz

Printing, file packaging, and miscellaneous commands


Each question is worth one point. Some questions ask you to select the best
answer, others ask you to select all the correct answers. To receive credit for
questions asking for all the correct answers, you must select all the correct
answers and only the correct answers.
1. All print requests are handled by which of the following?
Please select the best answer.
A. GNOME desktop environment
B. line printer daemon (lpd)
C. Shell
D. X Window System

2. What command displays all the jobs in the print queue named lp1.
Please select the best answer.
A. lpq -P lp1
B. lpr -P lp1
C. lprm -P lp1
D. lpr -h -P lp1

3. Which command lists the contents of the DOS diskette in the primary floppy
drive?
Please select the best answer.
A. mdir a:
B. mdir b:
C. mdir /dev/DOS
D. mcopy myfile a:\myfile
4. Which tar command creates an archive called myfile.tar and adds
the file named myfile1 to it?
Please select the best answer.
A. tar cvf myfile1 myfile2 myfile3
B. tar xvf myfile.tar
C. tar cvf myfile.tar myfile1
D. tar cvf myfile1 myfile.tar

5. The tar command can compress files as it archives them with what option?
Please select the best answer.
A. x
B. v
C. c
D. z

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
You're the installation expert
The scenario
As the proud owner of a shiny new Red Hat® Linux
CD-ROM, you are anxious to get started with installing
Linux on your home PC.
Because you use your machine primarily to do word
processing, surf the Internet, and play games, and you need
also to have access to both Linux and Windows so you can
still use the software you already own, you have opted to do
a Workstation dual-boot install. You know that this means
you'll be creating separate partitions for both Red Hat Linux
and Windows on your machine.

You'll need to use the information contained in the case file


to plan your installation, conduct the simulated installation,
and answer the questions that follow. You may also be
required to make some assumptions along the way. Where
you have done this, make a note of it in your answer.

Your goal As you now know, preparation is critical to a successful


install. You decide to start by creating your installation plan,
and gathering the information you'll need. What will you be
using your machine for, and what kind of partitioning
strategy will you need? What hardware configuration do you
have? Is it listed on the Linux Hardware Compatibility
Guide? Are you using any new devices, and if so do you
have the appropriate drivers? You'll address these and other
questions in the upcoming exercise.

Let's get started!

Exercise
Click the Exercise button to begin the course project.
Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Files, directories, and permissions
Scenario
Your system has been successfully installed, and up and
running for a few weeks, and you have spent many hours
carefully fine-tuning everything. However, you've recently
realized that you must have made a change somewhere that
you shouldn't have. Whenever you try to enter some of the
subdirectories in your home directory (or even view the
contents of files without entering them), you get a
permission-denied error message.

Later on, you discover an even more serious problem: if you


log on as another user and try to access the contents of your
own home directory, you are able to read all files.

Your goal Your goal is to troubleshoot the problem. You need to figure
out exactly what changes need to be made to your files and
directories, so that you have full access to everything in your
own home directory and so no one else has access to
anything except what is in the public area on your filesystem.

Exercise
Before moving on to the next lesson, click the Exercise
button to complete an exercise on file manipulation.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

You're the installation expert


Completing a dual-boot installation using Disk Druid
Objective
Complete a dual boot installation using Disk Druid
Scoring
This portion of the course project is worth 10 points. To receive full credit, you'll need to complete the
evaluative simulation, answer several questions about the preparation and install process, and then
submit your answers to a tutor.
Problem statement
Your goal is to identify and present your planning and preparation strategy for completing a dual-boot
installation, and then complete part of the installation process. You will need to make your decision
based on the information presented in the case file.

Start by reviewing the instructions below. You will need to review the information presented in the case
file to answer the questions and to complete the simulation, then you'll need to submit your solution to a
tutor.

It is recommended that you first review the questions, then


complete the simulation, and lastly use the text box below to
submit your anwers to a tutor.

Instructions
1. Review the information in each of the tabs provided.
2. Evaluate the information presented to you, paying special attention to the partitioning structure.
3. Answer the questions listed below, and submit them to a tutor using the text entry box at the end of
the lesson.
4. Complete the simulation: a dual-boot installation using Disk Druid.
Questions
Describe your overall installation strategy, addressing each of the following in your answer.
1. List five questions you'd need to ask in preparing to conduct a Workstation dual-boot installation
for this system.
2. List one potential setback you've identified in the scenario, and describe the steps you'd take to
avoid this problem.
3. Complete the checklist provided, and reference it in your solution.
Hints
Consider the importance of not losing previous data, understanding how and why to bypass the default,
workstation partitioning setup, using Disk Druid over the FIPS partitioning tool, and having enough disk
space for both Windows and Linux.
Getting started
You know that before you get started planning your installation, you need to consider a few global
questions. You will not need to address these questions directly in your submitted solution. They are
simply provided to help you to get you started.
● Why are you installing Linux?

● What is this machine's primary job?

● What is this machine's secondary job, if any?

● How many users do you think will need access to this machine?

● What software packages are you planning on installing on this machine?

Use all the information available to you in the Case File below to accomplish your task.

Now that you have reviewed the questions, please continue with the simulation below.
Partitioning using Disk Druid
Since you'll be booting from the CD-ROM, you've already edited your machine's initial boot instructions,
contained in the BIOS. Since this is a direct install and you're still fairly new to Linux, you've decided to
opt for the default graphical install method using Disk Druid, a graphical tool that allows you to partition
your hard drive.

Setting up the manual partitions


In the default Workstation install, Disk Druid will set up your Linux partitions within the one large Linux
partition. However, you will need to manually add the /home partition, and set both the /home and
/(root) partitions so that they will expand to fill the remainder of the hard drive space (3GB total) that
was originally reserved for Linux.
Performing a manual partition can be confusing at first. Refer to
the partition structure diagram provided in the Case File as you are
completing the simulation.

Remember that you'll need to use all the information available to you in the Resource file to accomplish
your task.
Let's get started!
Remember to complete the checklist provided, and reference it in your solution. Describe your overall
installation strategy, addressing each of the three questions listed above.
Getting feedback
When you have completed the exercise, submit your responses to your tutor for grading and assessment
by entering them into the text box below. Click the OK, I'm Done button to submit your answer to a
tutor. Remember to complete all parts of the exercise before submitting your solution to a tutor.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course conclusion
Congratulations! You made your way through the first
Transcript course in the Introduction to Red Hat® Linux series. Give
yourself a pat on the back. Linux is not an easy operating
system to master--but you're well on your way.
Now that you've completed this course, you should be able
to:
● Install Red Hat Linux

● Navigate through the Linux filesystem at the


command line and in the GNU Midnight Commander
● Manipulate the filesystem

● Edit text files

● Work with your user account

In completing the exercises in the course project, you have


gained real-world experience in applying your new skills.
You now know how important forethought and planning are
to a successful install. You also understand what the
installation wizard requires from you, and how to make the
best choices for your situation. You should now be able to
install Red Hat Linux with confidence.

Next lesson In the next lesson, you'll find out what course you should
take next.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Exercise

Files, directories, and permissions


Manipulating files

Navigate the filesystem, create directories, and use permissions.

Scoring
This portion of the course project is worth 10 points. To receive full credit, you'll need to use the Case
File to answer the questions below, and submit those solutions to a tutor.
Problem statement
Your job is to configure your home directory filesystem so that:
● It is secure

● You have access to everything

● Everyone is able to examine the contents of your public area (/home/redhat/pub), but is not
able change anything in it
You need to examine the current directory permissions to ensure that each of the triads (owner, group,
and other) is doing its job properly. You also need to consider what file permissions must be in place to
allow only read access to your pub directory.
You are placed in this directory automatically when you log in, since it is your home directory. Its
structure is as follows:
The long format file listing of your home directory itself is as follows.

Finally, the long format file listing of your home directory's contents is as shown below.

Instructions
You will need to do the following.
1. Change the permissions on your home directory so no one except you can enter it or use its
contents.
2. The file dans_file used to be in the list but is not anymore. This file was a symbolic link to
/tmp/dans. Restore the link.
3. Re-create your pub directory so users can list and read its contents, but not execute or alter
anything.
4. Explain how and why you chose to reconfigure permissions in your directory.
Getting feedback
When you've completed the exercise, submit your responses to your tutor for grading and assessment by
entering them into the text box below. Click the OK, I'm Done button to submit your answer to a tutor.
Remember to complete all parts of the exercise before submitting your solution to a tutor.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Where do you go from here?

In this course, you learned a great deal about how the Linux
filesystem works. You reviewed concepts relating to PC
architecture and you probably understand more than you ever
did before about the hardware in your system.

You're now ready to move to the next step! The next course
in this series covers the GUI in greater detail, and GNOME
in particular. You'll apply what you've learned about the
filesystem and file manipulation to make use of command
line tools and shell scripting to fine-tune your system.

Course PDF Don't forget that you can review the material in this course
file anytime and anywhere by downloading the compressed PDF
file available on the Resources page. This file contains all
lesson, quiz, and exercise content in the course.

Next lesson In the next lesson, we'll ask you for some feedback.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course conclusion
Way to go! (Audio transcript)
Well, we've covered a lot of ground here. You've
learned a lot about installing Red Hat® Linux and how to get
through the process with your sanity intact. You've learned
about the necessity of checking your hardware against the
compatibility lists in order to save yourself from headaches,
and you've completed a lot of simulations to prepare you for
the real thing!
You learned about how Linux sees the files and directories in
its filesystem and how to navigate through them, manipulate
them, and make sure that your basic levels of security are in
place by manipulating and understanding permissions.
Finally, you learned how to log in to the system and how
Linux knows who you are and how it keeps track of all the
different users it can handle.

Remember, it is not important for you to be familiar with the


finite details of each command you've learned in this course,
but it is imperative that you take the opportunity to apply
what you've learned in a live environment. We hope you
have enjoyed your journey through this course, and hope to
see you again later in the Linux series. It's been great
working together!

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
We'd love your feedback

Please take a couple of minutes to complete the simple


course evaluation on the next page. This is your chance to let
us know how you think we can improve our courses--we'll
really use your input! Additionally, completing the survey
signifies you have finished the course and it may be a
requirement for students with a company account.
@CEU_TEXT@

Your If you have any comments about your Web-based training


comments are experience in general, you can also send us your feedback
appreciated via email.

Next lesson In the next lesson, we'll ask you to fill out our evaluation
form.

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Course survey
@SURVEY_CEU_TEXT@ @SURVEY@

Copyright © 2000 DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights reserved. Linux is a
registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo, and all Red Hat-based trademarks and logos
are trademarks or registered trademarks of Red Hat, Inc., in the United States and other countries.
Introduction to Red Hat Linux I

Glossary

Annihilate
An X Window System operation whereby a window is closed and the
running application is killed.
Argument
An additional value required to complete a command.
ASCII (American Standard Code for Information Interchange)
Represents raw text that can be typed from a keyboard.
Bash shell
The Bourne Again shell, an updated version of the original UNIX shell,
the Bourne shell (sh). This is the standard command line processor used
in Linux systems today, and was developed for the GNU project.
Binaries
A compiled program of instructions for the CPU, which is unreadable by
people. Executable programs.
BIOS (The Basic Input/Output System)
A chip on the computer’s motherboard that saves information about the
hardware on the machine. This chip has the responsibility of starting the
computer from power up, and then passing control to the operating
system.
Bleeding edge hardware
Hardware just released onto the market, using brand new technology.
Blocks
A chunk of data stored on media such as a hard drive.
Boot
To start up the computer.
Boot manager
Allows you to select the operating system you wish to boot into.
Boot procedure
The process the computer system goes through when powering up.
Bourne Again shell
The standard command line processor used in Linux systems today,
developed for the GNU project. The bash shell.
BSD style
One of the original versions of UNIX developed at the University of
California at Berkeley. Berkeley Systems Distribution (BSD) is the
parent of one family of UNIX operating systems, and is partially behind
Linux as well, along with System V. Some things in Linux are done the
BSD way.
Character device
A device which transmits data one character at a time, such as a printer.
Character wildcard
A character that is used in a regular expression. A character wildcard
represents one character only in a pattern.
Chip
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

A piece of hardware that processes, retrieves, or in some way


manipulates data a computer’s motherboard.
chmod
The Linux command for changing an item’s permissions.
Command completion
The feature of the bash shell that lets you type part of a command and
use the Tab key to expand it.
Command history
The record of the commands you have used previously. The command
used is history.
Command line editing
A feature of the command line interpreter (shell) which allows the user
to modify the command they are typing as they type it using vi or emacs
capabilities. This is useful for long commands requiring many options.
Concatenate
Linking items together in a series or chain. An example would be when
the cat command is used to send the contents of a file to STDIN.
Copyleft
The opposite of a copyright. It permits everyone the ability to use and
modify the program as long as they make it available to everyone else
under the same conditions. The combination of copyright and extension
applied by GNU to form the GNU Public License (GPL).
Data integrity
The issue of whether data arrived in its destination uncorrupted.
Desktop environment
A set of components including the window manager, a file manager,
configuration editor, which make up the user’s environment. This is
usually an extension built on top of the X Window System itself.
Disk image
An image is all the data necessary to create a boot disk and has to be
reproduced in the exact bit and byte order it was created in onto the
target floppy disk. The images you need are provided on the CD-ROM
in the /images subdirectory.
Driver
A program that enables the operating system to communicate with a
particular hardware device.
Dual-boot
Installing two operating systems on the same PC, with a menu system to
let you choose between them at boot time.
Emacs
A standard UNIX text editor specialized to the task of programming in
different languages.
Executable path
The location of a file within the file system hierarchy, contained within
the PATH environment variable.
Execute access
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

The permission given to a user that allows them to execute (run) a


program.
File manager
A program which allows the user to view, list, and manipulate files on the
hard drive.
Filename completion
The feature of the bash shell that lets you type part of a file name and
use the Tab key to expand it.
Filename expansion
A feature of the command line interpreter (shell) which will use
wildcards to search for a particular file name and complete typing the
name using filename completion.
Free space
Unused storage media (like a hard drive) space.
gEdit
A text editor provided by GNOME.
Ghostscript
A document viewer that interprets and displays PostScript data files. The
free version of PostScript, mostly used in UNIX.
Glossary
Each time you click a glossary term, you'll see a window like this
displaying the term and its definition. To see the entire glossary, click
Show All Terms.
GMC(GNU Midnight Commander)
A file manager developed for the GNU project and the default GNOME
file manager.
GNOME (GNU Network Object Model Environment)
A graphical interface for Linux, GNOME is a part of the larger GNU
project.
GNU
Stands for "Gnu's Not Unix". A project of the Free Software Foundation
with the goal of developing a free operating system and associated tools.
GNU Midnight Commander
A file manager developed for the GNU project.
GPL (GNU Public License)
A software license structure that ensures software is available to all.
GUI (Graphical User Interface)
A point and click environment, like Windows or the Macintosh.
Iconify
The act of minimizing a running program within the X Window System
by creating an icon on the desktop.
IDE (Integrated Drive Electronics)
An IDE is the "normal" hard drive, the one that any PC can handle
without additional hardware. The IDE is different from the SCSI hard
drive.
Info
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

A set of informational help guide pages distributed with the Linux


operating system.
ISP
Stands for Internet Service Provider. An ISP is an organization that
provides access to the Internet.
Kernel
The operating system itself, its central core.
Kernel module
The Linux kernel is a bunch of smaller pieces called modules. Each
module provides a specific piece of kernel functionality, such as a device
driver.
Libraries
Collections of code that can be reused by other programs.
LILO
LInux LOader is a boot manager. When it’s starting up, the BIOS
checks two places on the system. The first is the Master Boot Record.
The second is the boot manager. The boot manager provides a menu
system listing the available operating systems.
Line printer daemon
The program that runs in the background and handles the files you print.
LPD
The Line Printer Daemon is the program which handles all user requests
for printing services.
LPR
Stands for Line PrinteR Daemon. The program that controls the printer
devices, as well as any requests from users to print a job on the printer.
Main Menu
The icon in the lower left-hand corner of the GNOME Panel, which has
a foot icon on it.
Man
The manual (help) system for Linux and UNIX. Online manual pages
distributed with the Linux operating system.
Master Boot Record
The very first sector on your hard drive, where the BIOS looks when it’s
ready to start the operating system at boot time.
Motherboard
The large card that contains your computer’s brain and memory, and on
which all other cards are seated.
Mount point
The link between a partition of disk space that contains files in a
directory, and its location in the filesystem.
MS-DOS
The first of the Microsoft operating systems (MicroSoft Disk Operating
System). Command-line based.
Natural language interface
A feature of the command line interpreter (shell) that attempts to make
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

interaction with the shell more intuitive and closer to a normal manner of
speaking or writing.
Nongraphical Text-based interface
Refers to the command line interface.
Open source
The movement and practice of ensuring that source code is available for
people to examine.
Option
A command line parameter used to provide extra information to a
program.
Path statement
The path statement is the directory (folder) structure with a file name at
the end.
PCMCIA
(Personal Computer Memory Card International Association). A device
used to connect external hard drives and other components to a laptop
computer.
Permissions
Security features used in the Linux filesystem to determine who has
access to what. The ability to read, write, or execute a file, which can be
granted to a user or revoked from them.
Pico
A Linux text editor.
Pipe
A feature that allows you to take output from one command and feed it
as the input to another.
Plug and Play
Attribute of the device (video card, and so on.) that it can be configured
by the operation system, and requires little intervention by the user.
POSIX (Portable Operating System Interface for UNIX)
A standard that defines the interface among application programs and
the UNIX operating system.
PostScript
A common printer control programming language used for page layout.
PostScript was developed to allow a document to look the same
independent of what printer it was printed on.
Printer daemon
The program that controls the printer devices, as well as any requests
from users to print a job on the printer.
Print queue
The collection files that have been sent to the printer, but have not been
printed yet.
PS
Stands for PostScript. A common printer control language that was
developed to allow a document to look the same independent of what
printer it was printed on.
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

Pseudo terminal
A device on the Linux system that acts like a terminal. Allows users to
log in as if they were connecting with a real terminal device.
RAM (Random Access Memory)
Your computer’s memory.
Range wildcard
A character used to represent a series of characters, such as a-z.
Read access
Permission to look at the contents of a file or directory.
Redirection
Diverting output from a program from its normal destination, for example
to a disk file rather than the screen.
Root user
The administrator of the machine, which has access to all commands and
all portions of the filesystem.
SCSI
SCSI is an interface that allows PCs to communicate with devices such
as disk drives, tape drives, CD-ROM drives, printers, and scanners
faster and more flexibly than interfaces such as IDE. Part of the
advantage of using SCSI is that you are not limited to the single SCSI
port you may have. With most SCSI cards, you can hang SCSI devices
off of one another and still use them all effectively in this way.
Shell
The command line interpreter on a Linux system. It takes input from the
user and sends instructions to the kernel to be performed.
Shell history
The record of the commands executed during a login session.
Source code
The files used to build a binary program.
Special character
A nonalphabetic or nonnumeric character that means something specific
to a shell. Examples are +, @, $, &.
SSH
Stands for Secure Shell. The SSH client is a separate program that you
install on your computer. In this course, SSH provides a secure terminal
connection from your computer to the computer running the Linux lab.
STDERR
Stands for STanDard ERRor. The output channel error messages are
sent to in Linux.
STDIN
Stands for Standard Input, and is the source for input from a user or
another program. This is usually the keyboard.
STDOUT
Stands for Standard Output, and is the destination for output in a
program. This is usually the screen, but can also be another program or
file.
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.
Introduction to Red Hat Linux I

String
A collection of alphanumeric characters.
String wildcard
A character used in a regular expression that represents a string of
characters in a pattern.
Superuser
The system administrator, who has unlimited access. The superuser is
also known as root, and is the highest privileged user account on a Linux
system.
Swap partition
Hard drive space used when the computer’s memory is full.
Swap space
Hard drive space used when the computer’s memory is full.
Terminal
Historically a hardware device, but today more likely to be a pseudo
terminal. An I/O device that usually has a keyboard for input and a
screen for output.
Text editor
A text editor is a program that allows you to view and work on a file in a
window. If you have used a word processing program like Microsoft
Word® you have used a text editor.
Vi
A text editor used to edit files.
Virtual terminal
One of the six available login sessions on a Linux box.
VRAM (Video Random Access Memory)
The memory chips on a video card.
Wildcard
A character used to represent other characters.
Words
Groups of characters on the command line which are broken up by the
shell and then executed by the kernel.
Work buffer
This is a temporary space where work is kept before it is saved to the
file. This space is often a file in the /tmp directory. For example, if you
are working in an editor, the file is opened as a copy and a version is
typically saved in /tmp with some unintelligible name. Until you save
changes, you are working on the copy in /tmp or on one held in RAM,
not on the file itself.
Write access
Permission setting that allows you to save data to a location or to a
specific file.
X Windows System
The standard GUI for UNIX and Linux. It uses representative icons,
windows, menus, and a mouse pointer to interact with the computer
operating system.
Copyright © DigitalThink, Inc. All Rights Reserved. Portions Copyright 2000 Red Hat, Inc. All rights
reserved. Linux is a registered trademark of Linus Torvalds. Red Hat, the Red Hat "Shadow Man" logo,
and all Red Hat-based trademarks and logos are trademarks or registered trademarks of Red Hat, Inc., in
the United States and other countries.

You might also like