GettingStarted Linux
GettingStarted Linux
Table of Contents
Introduction i
1. Changes to This Manual ...........................................................................................i
2. Document Conventions. ..........................................................................................ii
3. Copying and Pasting Text With X ............................................................................iv
4. Using the Mouse ......................................................................................................v
5. We Need Feedback! ................................................................................................v
6. Sign Up for Support .................................................................................................v
1. Getting Started 1-15
1.1. Setup Agent............................................................................................................ 1
1.2. Introductory Terms.................................................................................................5
1.3. Logging In................................................................................................................ 7
1.3.1. Graphical Login...............................................................................................7
1.3.2. Virtual Console Login......................................................................................8
1.4. Graphical Interface..................................................................................................9
1.5. Opening a Shell Prompt...........................................................................................9
1.6. Creating a User Account........................................................................................10
1.7. Documentation and Help......................................................................................11
1.7.1. Manual Pages...............................................................................................11
1.7.2. Red Hat Linux Documentation......................................................................13
1.8. Logging Out........................................................................................................... 15
1.8.1. Graphical Logout..........................................................................................15
1.8.2. Virtual Console Logout.................................................................................15
1.9. Shutting Down your Computer..............................................................................15
1.9.1. Graphical Shutdown.....................................................................................15
1.9.2. Virtual Console Shutdown............................................................................15
2. Using the Graphical Desktop 16-24
2.1. Using the Desktop............................................................................................ 16
2.2. Using the Panel......................................................................................................17
2.2.1. Using the Main Menu................................................................................17
2.2.2. Using Applets.............................................................................................17
2.2.3. Using the Notification Area........................................................................18
2.2.4. Adding Icons and Applets to the Panel.......................................................19
2.2.5. Configuring the Desktop Panel...................................................................20
2.3. Using Nautilus.......................................................................................................20
iv
2.4. Start Here..............................................................................................................21
2.4.1. Customizing the Desktop............................................................................21
2.4.2. Customizing your System ..........................................................................24
2.5. Logging Out..........................................................................................................`24
3. Configuring the Date and Time 26-28
3.1. Time and Date Properties......................................................................................26
3.2. Time Zone Configuration.......................................................................................28
4. Diskettes and CD-ROMs 30-42
4.1. Using Diskettes......................................................................................................30
4.1.1. Mounting and Unmounting a Diskette.......................................................30
4.1.2. Putting Linux Files on an MS-DOS Diskette.................................................31
4.1.3. Formatting a Diskette.................................................................................31
4.2. CD-ROMs.............................................................................................................. 33
4.2.1. Using CD-ROMs with Your File Manager....................................................33
4.2.2. Using CD-ROMs From a Shell Prompt.........................................................34
4.3. CD-Rs and CD-RWs................................................................................................35
4.3.1. Using CD Creator........................................................................................35
4.3.2. Using X-CD-Roast..................................................................................37-40
[Link]. Using X-CD-Roast to Duplicate CD-ROMs........................................38
[Link]. Using X-CD-Roast to Create a CD
[Link]. Writing ISOs with X-CD-Roast..........................................................40
4.3.3. Using CD-Rs and CD-RWs with Command Line Tools..............................40-1
[Link]. Using mkisofs
[Link]. Using cdrecord..........................................................................41
4.4. Additional Resources.............................................................................................42
4.4.1. Installed Documentation............................................................................42
4.4.2. Useful Websites..........................................................................................42
5. Getting Online 44-6
6. Web Browsing 48-53
6.1. Mozilla...................................................................................................................48
6.1.1. Using Mozilla..............................................................................................49
6.1.2. Mozilla Composer.......................................................................................50
6.2. Galeon...................................................................................................................51
6.3. Web Browser Keyboard Shortcuts........................................................................53
7. Email Applications 54-62
7.1. Evolution............................................................................................................... 55
7.2. Mozilla Mail...........................................................................................................58
7.2.1. Mozilla and Newsgroups............................................................................59
v
7.3. Plain Text Email Clients..........................................................................................60
7.3.1. Using Mutt.................................................................................................61
8. Printer Configuration 64-73
8.1. The Printer Configuration Tool.............................................................................64
8.2. Adding a Local Printer...........................................................................................64
8.3. Selecting the Printer Model and Finishing.............................................................66
8.3.1. Confirming Printer Configuration...............................................................67
8.4. Printing a Test Page...............................................................................................67
8.5. Modifying Existing Printers....................................................................................68
8.5.1. Queue Name..............................................................................................69
8.5.2. Queue Type................................................................................................69
8.5.3. Printer Driver.............................................................................................69
8.5.4. Driver Options............................................................................................69
8.6. Managing Print Jobs..............................................................................................70
8.7. Additional Resources.............................................................................................73
8.7.1. Installed Documentation............................................................................73
8.7.2. Useful Websites..........................................................................................73
9. Working with Documents 74-86
9.1. The [Link] Suite......................................................................................74
9.1.1. [Link] Features............................................................................74
9.1.2. [Link] Writer...............................................................................75
9.1.3. [Link] Calc...................................................................................77
9.1.4. [Link] Impress.............................................................................79
9.1.5. [Link] Draw.................................................................................82
9.2. Editing Text Files....................................................................................................83
9.2.1. Shell Prompt Text Editors...........................................................................84
9.3. Viewing PDFs.........................................................................................................85
10. Audio, Video, and General Amusement 88-94
10.1. Playing Audio CDs...............................................................................................88
10.2. Playing Digital Audio Files..................................................................................89
10.2.1. Using XMMS.........................................................................................89
10.3. Troubleshooting Your Sound Card.....................................................................91
10.3.1. If Sound Card Configuration Tool Does Not Work..............................91-
[Link]. Manual Sound Card Configuration................................................92
10.4. Troubleshooting Your Video Card......................................................................92
10.5. Games................................................................................................................94
10.6. Finding Games Online........................................................................................94
vi
11. Working with Images 96-104
11.1. Viewing Images...................................................................................................96
11.1.1. Using Nautilus to View Images..............................................................96
11.1.2. Using gThumb....................................................................................97-
[Link]. Changing your Desktop Wallpaper with gThumb.......................99
[Link]. Configuring gThumb
11.2. Manipulating Images with the GIMP...............................................................100
11.2.1. GIMP Basics.....................................................................................100
11.2.2. Loading a File.......................................................................................100
11.2.3. Saving a File.........................................................................................102
11.2.4. GIMP Options....................................................................................102
11.3. Additional Resources.........................................................................................104
11.3.1. Installed Documentation.....................................................................104
11.3.2. Useful Websites..................................................................................104
11.3.3. Related Books......................................................................................104
12. Working with Digital Cameras 106
12.1. Using gtKam...................................................................................................106
13. Shell Prompt Basics 108-130
13.1. Why Use a Shell Prompt....................................................................................108
13.2. The History of the Shell.....................................................................................108
13.3. Determining Your Current Directory with pwd................................................109
13.4. Changing Directories with cd..........................................................................109
13.5. View Directory Contents with ls....................................................................112
13.6. Locating Files and Directorie ............................................................................114
13.7. Printing From The Command Line.................................................................115
13.8. Clearing and Resetting the Terminal.................................................................115
13.9. Manipulating Files with cat............................................................................116
13.9.1. Using Redirection................................................................................116
13.9.2. Appending Standard Output...............................................................118
13.9.3. Redirecting Standard Input.................................................................119
13.10. Pipes and Pagers..............................................................................................120
13.10.1. The more Command......................................................................121
13.11. More Commands for Reading Text Files..........................................................122
13.11.1. The head Command......................................................................122
13.11.2. The tail Command......................................................................122
13.11.3. The grep Command......................................................................122
13.11.4. I/O Redirection and Pipes..................................................................123
13.11.5. Wildcards and Regular Expression ...................................................123
vii
13.12. Command History and Tab Completion..........................................................124
13.13. Using Multiple Commands..............................................................................125
13.14. Ownership and Permissions............................................................................126
13.14.1. The chmod Command...................................................................128
13.14.2. Changing Permissions With Numbers...............................................130
14. Managing Files and Directories 132-143
14.1. A Larger Picture of the File System....................................................................132
14.2. Identifying and Working with File Types...........................................................133
14.2.1. Compressed and Archived Files...........................................................133
14.2.2. File Formats.........................................................................................133
14.2.3. System Files.........................................................................................134
14.2.4. Programming and Scripting Files.........................................................134
14.3. File Compression and Archiving........................................................................134
14.3.1. Using File Rolle ..................................................................................135-
[Link]. Decompressing and Unarchiving with File Roller........................136
[Link]. Creating Archives with File Roller
14.3.2. Compressing Files at the Shell Prompt...............................................138-
[Link]. Bzip2 and Bunzip2.......................................................................138
[Link]. Gzip and Gunzip..........................................................................139
[Link]. Zip and Unzip
14.3.3. Archiving Files at the Shell Prompt......................................................140
14.4. Manipulating Files at the Shell Prompt.............................................................141
14.4.1. Creating Files.......................................................................................141
14.4.2. Copying Files........................................................................................142
14.4.3. Moving Files........................................................................................142
14.4.4. Deleting Files and Directories..............................................................143
15. Installing and Updating Red Hat Linux Packages 146-150
15.1. Red Hat Network...............................................................................................146
15.2. Errata List.......................................................................................................... 148
15.3. Installation CD-ROMs........................................................................................149
15.4. Downloaded Packages.......................................................................................150
16. Frequently Asked Questions........................................................................152-158
16.1. Localhost Login and Password...........................................................................152
16.2. Error Messages During Installation of RPMs.....................................................152
16.3. Starting Applications.........................................................................................153
16.3.1. Editing Your PATH...............................................................................153
16.4. Accessing a Windows Partition..........................................................................154
16.5. Finding Commands Quickly...............................................................................156
viii
16.6. Tips on Using Command History.......................................................................157
16.6.1. Other Shortcuts...................................................................................157
16.7. Keep ls Output from Scrolling............................................................................157
16.7.1. Printing ls Output................................................................................157
16.8. Forgotten Password...........................................................................................158
16.9. Password Maintenance.....................................................................................158
16.10. Changing Login from Console to X at Startup..................................................158
A. KDE: The K Desktop Environment .................................................................160-174
A.1. Introducing KDE..................................................................................................160
A.2. Finding Help........................................................................................................160
A.3. Using The Desktop..............................................................................................161
A.4. Using The Panel....................................................................................................16
A.4.1. Using The Main Menu.............................................................................163
A.4.2. Using Applets..........................................................................................164-
A.4.2.1. Working with Multiple Desktops..................................................164
A.4.2.2. Viewing The Taskbar.....................................................................166
A.4.3. Adding Icons and Applets to the Panel....................................................166
A.4.4. Configuring the KDE Panel ......................................................................166
A.5. Managing Files....................................................................................................167
A.5.1. The Navigation Panel...............................................................................168
A.6. Browsing the Web with Konqueror....................................................................168
A.7. Using Konqueror to View Images........................................................................170
A.8. KMail...................................................................................................................172
A.9. Customizing KD...................................................................................................173
A.10. Logging Out of KDE............................................................................................174
B. Applications 176
C. A Comparison of Common DOS and Linux Commands 178
D. System Directories 180
E. Keyboard Shortcuts 182
Index........................................................................................................................ 184
Colophon................................................................................................................. 18*
ix
Contents
Table of Contents........................................................................................................................................................iii
Introduction..............................................................................................................................................................xvi
Changes to This Manual...........................................................................................................................................xvii
Document Conventions............................................................................................................................................xvii
Copying and Pasting Text With X................................................................................................................................xx
Using the Mouse........................................................................................................................................................xx
We Need Feedback!...................................................................................................................................................xx
Sign Up for Support...................................................................................................................................................xxi
Steps to Get You Started.............................................................................................................................................1
1.1. Setup Agent..........................................................................................................................................................1
1.2. Introductory Terms...............................................................................................................................................4
1.3. Logging In.............................................................................................................................................................6
1.3.1. Graphical Login..............................................................................................................................................7
1.3.2. Virtual Console Login.....................................................................................................................................8
1.4. Graphical Interface...............................................................................................................................................8
1.5. Opening a Shell Prompt........................................................................................................................................8
1.6. Creating a User Account.......................................................................................................................................9
1.7. Documentation and Help....................................................................................................................................10
1.7.1. Manual Pages..............................................................................................................................................11
[Link]. Using man.............................................................................................................................................11
[Link]. Printing a Man Page..............................................................................................................................12
[Link]. The man Man Page...............................................................................................................................12
1.7.2. Red Hat Linux Documentation.................................................................................................................12
1.8. Logging Out.........................................................................................................................................................14
1.8.1. Graphical Logout......................................................................................................................................14
1.8.2. Virtual Console Logout.................................................................................................................................14
1.9. Shutting Down your Computer...........................................................................................................................14
1.9.1. Graphical Shutdown....................................................................................................................................14
1.9.2. Virtual Console Shutdown...........................................................................................................................14
Using the Graphical Desktop.....................................................................................................................................16
2.1. Using the Desktop...............................................................................................................................................16
2.2. Using the Panel...................................................................................................................................................17
[Link] the Main Menu...................................................................................................................................17
2.2.2. Using Applets...............................................................................................................................................17
2.2.3. Using the Notification Area..........................................................................................................................18
2.2.4. Adding Icons and Applets to the Panel........................................................................................................19
x
2.2.5. Configuring the Desktop Panel....................................................................................................................19
2.3. Using Nautilus.....................................................................................................................................................19
2.4. Start Here...........................................................................................................................................................20
2.4.1. Customizing the Desktop.............................................................................................................................21
[Link]. Changing your Desktop Background.....................................................................................................21
2.4.2. Customizing your System.............................................................................................................................23
2.5. Logging Out.........................................................................................................................................................24
Configuring the Date and Time..................................................................................................................................26
3.1. Time and Date Properties...................................................................................................................................26
3.2. Time Zone Configuration....................................................................................................................................27
Diskettes and CD-ROMs.............................................................................................................................................30
4.1. Using Diskettes...................................................................................................................................................30
4.1.1. Mounting and Unmounting a Diskette.........................................................................................................30
4.1.2. Putting Linux Files on an MS-DOS Diskette..................................................................................................31
4.1.3. Formatting a Diskette..................................................................................................................................31
[Link]. Using gfloppy........................................................................................................................................32
[Link]. Using mke2fs........................................................................................................................................32
4.2. CD-ROMs............................................................................................................................................................33
4.2.1. Using CD-ROMs with Your File Manager......................................................................................................33
4.2.2. Using CD-ROMs From a Shell Prompt..........................................................................................................34
4.3. CD-Rs and CD-RWs..............................................................................................................................................34
4.3.1. Using CD Creator..........................................................................................................................................34
4.3.2. Using X-CD-Roast.........................................................................................................................................35
[Link]. Using X-CD-Roast to Duplicate CD-ROMs..............................................................................................36
[Link]. Using X-CD-Roast to Create a CD..........................................................................................................38
[Link]. Writing ISOs with X-CD-Roast...............................................................................................................39
4.3.3. Using CD-Rs and CD-RWs with Command Line Tools...................................................................................40
[Link]. Using mkisofs..................................................................................................................................40
[Link]. Using cdrecord................................................................................................................................41
4.4. Additional Resources..........................................................................................................................................42
4.4.1. Installed Documentation.............................................................................................................................42
4.4.2. Useful Websites.......................................................................................................................................42
Getting Online...........................................................................................................................................................44
Web Browsing...........................................................................................................................................................44
6.1. Mozilla................................................................................................................................................................44
6.1.1. Using Mozilla...............................................................................................................................................45
6.1.2. Mozilla Composer........................................................................................................................................46
xi
6.2. Galeon................................................................................................................................................................47
6.3. Web Browser Keyboard Shortcuts......................................................................................................................49
Email Applications.....................................................................................................................................................48
7.1. Evolution.............................................................................................................................................................49
7.2. Mozilla Mail........................................................................................................................................................52
7.2.1. Mozilla and Newsgroups..............................................................................................................................53
7.3. Plain Text Email Clients.......................................................................................................................................54
7.3.1. Using Mutt...................................................................................................................................................54
Printer Configuration.................................................................................................................................................56
8.1. The Printer Configuration Tool...........................................................................................................................56
8.2. Adding a Local Printer.........................................................................................................................................56
8.3. Selecting the Printer Model and Finishing..........................................................................................................58
8.3.1. Confirming Printer Configuration.................................................................................................................59
8.4. Printing a Test Page............................................................................................................................................59
8.5. Modifying Existing Printers.................................................................................................................................60
8.5.1. Queue Name................................................................................................................................................61
8.5.2. Queue Type.................................................................................................................................................61
8.5.3. Printer Driver...............................................................................................................................................61
8.5.4. Driver Options..............................................................................................................................................61
8.6. Managing Print Jobs...........................................................................................................................................62
8.7. Additional Resources..........................................................................................................................................65
8.7.1. Installed Documentation.........................................................................................................................65
8.7.2. Useful Websites.......................................................................................................................................65
Working with Documents..........................................................................................................................................74
9.1. The [Link] Suite....................................................................................................................................74
9.1.1. [Link] Features..............................................................................................................................74
9.1.2. [Link] Writer.................................................................................................................................75
9.1.3. [Link] Calc.....................................................................................................................................77
9.1.4. [Link] Impress...............................................................................................................................79
9.1.5. [Link] Draw...................................................................................................................................81
9.2. Editing Text Files.................................................................................................................................................83
9.2.1. Shell Prompt Text Editors............................................................................................................................84
9.3. Viewing PDFs......................................................................................................................................................85
Audio, Video, and General Amusement....................................................................................................................88
10.1. Playing Audio CDs.............................................................................................................................................88
10.2. Playing Digital Audio Files.................................................................................................................................89
10.2.1. Using XMMS..............................................................................................................................................89
xii
10.3. Troubleshooting Your Sound Card....................................................................................................................91
10.3.1. If Sound Card Configuration Tool Does Not Work.....................................................................................91
[Link]. Manual Sound Card Configuration......................................................................................................92
10.4. Troubleshooting Your Video Card.....................................................................................................................92
10.5. Games...............................................................................................................................................................93
10.6. Finding Games Online.......................................................................................................................................94
Working with Images.................................................................................................................................................88
11.1. Viewing Images.................................................................................................................................................88
11.1.1. Using Nautilus to View Images...................................................................................................................88
11.1.2. Using gThumb............................................................................................................................................89
[Link]. Changing your Desktop Wallpaper with gThumb..............................................................................91
[Link] Configuring gThumb............................................................................................................................91
11.2. Manipulating Images with the GIMP................................................................................................................92
11.2.1. GIMP Basics...............................................................................................................................................92
11.2.2. Loading a File.............................................................................................................................................92
11.2.3. Saving a File...............................................................................................................................................94
11.2.4. GIMP Options............................................................................................................................................94
11.3. Additional Resources........................................................................................................................................96
11.3.1. Installed Documentation...........................................................................................................................96
11.3.2. Useful Websites.....................................................................................................................................96
11.3.3. Related Books........................................................................................................................................96
Working with Digital Cameras...................................................................................................................................98
12.1. Using gtKam......................................................................................................................................................98
Shell Prompt Basics.................................................................................................................................................108
13.1. Why Use a Shell Prompt.................................................................................................................................108
13.2. The History of the Shell...................................................................................................................................108
13.3. Determining Your Current Directory with pwd...............................................................................................109
13.4. Changing Directories with cd..........................................................................................................................109
13.5. View Directory Contents with ls.....................................................................................................................112
13.6. Locating Files and Directories.........................................................................................................................114
13.7. Printing From The Command Line..................................................................................................................115
13.8. Clearing and Resetting the Terminal...............................................................................................................115
13.9. Manipulating Files with cat.........................................................................................................................116
13.9.1. Using Redirection.....................................................................................................................................116
13.9.2. Appending Standard Output....................................................................................................................118
13.9.3. Redirecting Standard Input......................................................................................................................119
13.10. Pipes and Pagers...........................................................................................................................................120
xiii
13.10.1. The more Command..............................................................................................................................121
13.11. More Commands for Reading Text Files.......................................................................................................122
13.11.1. The head Command..........................................................................................................................122
13.11.2. The tail Command..........................................................................................................................122
13.11.3. The grep Command...............................................................................................................................122
13.11.4. I/O Redirection and Pipes......................................................................................................................123
13.11.5. Wildcards and Regular Expressions.......................................................................................................123
13.12. Command History and Tab Completion........................................................................................................124
13.13. Using Multiple Commands............................................................................................................................125
13.14. Ownership and Permissions......................................................................................................................126
13.14.1. The chmod Command............................................................................................................................128
13.14.2. Changing Permissions With Numbers....................................................................................................130
Managing Files and Directories...............................................................................................................................132
14.1. A Larger Picture of the File System.................................................................................................................132
14.2. Identifying and Working with File Types.........................................................................................................133
14.2.1. Compressed and Archived Files...............................................................................................................133
14.2.2. File Formats.........................................................................................................................................133
14.2.3. System Files.........................................................................................................................................134
14.2.4. Programming and Scripting Files.........................................................................................................134
14.3. File Compression and Archiving......................................................................................................................134
14.3.1. Using File Roller.......................................................................................................................................135
[Link]. Decompressing and Unarchiving with File Roller..............................................................................136
[Link]. Creating Archives with File Roller.....................................................................................................136
14.3.2. Compressing Files at the Shell Prompt....................................................................................................138
[Link]. Bzip2 and Bunzip2.............................................................................................................................138
[Link]. Gzip and Gunzip................................................................................................................................139
[Link]. Zip and Unzip....................................................................................................................................139
14.3.3. Archiving Files at the Shell Prompt..........................................................................................................140
14.4. Manipulating Files at the Shell Prompt...........................................................................................................141
14.4.1. Creating Files...........................................................................................................................................141
14.4.2. Copying Files............................................................................................................................................142
14.4.3. Moving Files.............................................................................................................................................142
14.4.4. Deleting Files and Directories..................................................................................................................143
Installing and Updating Red Hat Linux Packages.....................................................................................................146
15.1. Red Hat Network............................................................................................................................................146
15.2. Errata List....................................................................................................................................................148
15.3. Installation CD-ROMs..................................................................................................................................149
xiv
15.4. Downloaded Packages................................................................................................................................150
Frequently Asked Questions....................................................................................................................................152
16.1. Localhost Login and Password........................................................................................................................152
16.2. Error Messages During Installation of RPMs...................................................................................................152
16.3. Starting Applications.......................................................................................................................................153
16.3.1. Editing Your PATH....................................................................................................................................153
16.4. Accessing a Windows Partition.......................................................................................................................154
16.5. Finding Commands Quickly............................................................................................................................156
16.6. Tips on Using Command History.....................................................................................................................157
16.6.1. Other Shortcuts.......................................................................................................................................157
16.7. Keep ls Output from Scrolling.........................................................................................................................157
16.7.1. Printing ls Output.....................................................................................................................................157
16.8. Forgotten Password........................................................................................................................................158
16.9. Password Maintenance..................................................................................................................................158
16.10. Changing Login from Console to X at Startup...............................................................................................158
KDE: The K Desktop Environment............................................................................................................................160
A.1. Introducing KDE................................................................................................................................................160
A.2. Finding Help.....................................................................................................................................................160
A.3. Using The Desktop............................................................................................................................................161
A.4. Using The Panel................................................................................................................................................162
A.4.1. Using The Main Menu...............................................................................................................................164
A.4.2. Using Applets.........................................................................................................................................164
A.4.2.1. Working with Multiple Desktops........................................................................................................164
A.4.2.2. Viewing The Taskbar...........................................................................................................................166
A.4.3. Adding Icons and Applets to the Panel......................................................................................................167
A.4.4. Configuring the KDE Panel.........................................................................................................................167
A.5. Managing Files..................................................................................................................................................168
A.5.1. The Navigation Panel.................................................................................................................................169
A.6. Browsing the Web with Konqueror..................................................................................................................169
A.7. Using Konqueror to View Images.....................................................................................................................171
A.8. KMail................................................................................................................................................................172
A.9. Customizing KDE...............................................................................................................................................174
A.10. Logging Out of KDE.........................................................................................................................................175
Applications.............................................................................................................................................................176
A Comparison of Common DOS and Linux Commands............................................................................................178
Table C-1. Similar Commands..........................................................................................................................179
System Directories...................................................................................................................................................180
xv
Keyboard Shortcuts.................................................................................................................................................182
xvi
Introduction
Welcome to the Red Hat Linux Getting Started Guide!
By now, you should have read the Red Hat Linux Installation Guide and successfully
installed Red Hat Linux. This manual is designed to help new and intermediate Linux users
navigate and perform common tasks. Keep in mind that Linux looks, feels, and performs
differently from other operating systems you may have used. Forget about the
conventions of other operating systems and, with an open mind, approach Red Hat Linux
as a new, interesting, and versatile alternative.
This manual is task-oriented. You will find useful tips, hints, warnings, and screen shots
interspersed throughout. First, you will learn the basics of using Red Hat Linux, such as
customizing a desktop, configuring a printer, and getting online. Once the basics are
covered, the tasks covered in this manual become progressively more advanced.
Most users choose to work within either the GNOME or KDE graphical desktop
environments (other desktop environments are also available). The Red Hat Linux Getting
Started Guide focuses primarily on how to perform tasks in these two environments.
Topics discussed include:
• Using the graphical desktop environment
• Managing files and directories • Working with documents
• Using the Web and email • Working with a digital camera
After conquering the basics of your Red Hat Linux system, you may need information on
more advanced topics. You can find this information in the Red Hat Linux Customization
Guide, the Red Hat Linux Reference Guide, the Red Hat Linux System Administration
Primer, and the Red Hat Linux Security Guide.
HTML and PDF versions of the Red Hat Linux manuals are available on the
Red Hat Linux Documentation CD and online at [Link]
Note
Although this manual reflects the most current information possible, you should
read the Red Hat Linux Release Notes for information that may not have been
available prior to our documentation being finalized. They can be found on the Red
Hat Linux CD #1 and online at: [Link]
xvii
Note
Remember that Linux is case sensitive. In other words,
a rose is not a ROSE is not a rOsE.
Tip
The directory /usr/share/doc contains additional documentation for packages
installed on your system.
xx
Important
If you modify the DHCP configuration file, the changes will not take effect until you
restart the DHCP daemon.
Caution
Do not perform routine tasks as root — use a regular user account unless you need to
use the root account for system administration tasks.
Warning
If you choose not to partition manually, a server installation will remove all existing
partitions on all installed hard drives. Do not choose this installation class unless you
are sure you have no data you need to save.
Copying and Pasting Text With X
Copying and pasting text is easy using your mouse and the X Window System. To copy
text, simply click and drag your mouse over the text to highlight it. To paste the text
somewhere, click the middle mouse button in the spot where the text should be
placed.
Using the Mouse
Red Hat Linux is designed to use a three-button mouse. If you have a two-button
mouse, you should have selected three-button emulation during the installation
process. If you’re using three-button emulation, pressing both mouse buttons at the
same time equates to pressing the missing third (middle) button.
In this document, if you are instructed to click with the mouse on something, that
means click the left mouse button. If you need to use the middle or right mouse
button, that will be explicitly stated. (This will be reversed if you’ve configured your
mouse to be used by a left handed person.)
The phrase "drag and drop" may be familiar to you. If you’re instructed to drag and
drop an item on your GUI desktop, click on something and hold the mouse button
down. While continuing to hold down the mouse button, drag the item by moving the
mouse to a new location. When you’ve reached the desired location, release the
mouse button to drop the item.
We Need Feedback!
If you spot a typographical error in the Red Hat Linux Getting Started Guide, or if you
have thought of a way to make this manual better, we would love to hear from you!
xxi
Please submit a report in Bugzilla
([Link] against the component rhl-
gsg. When submitting a bug report, be sure to mention the manual’s identifier:
rhl-gsg(EN)-9-Print-RHI (2003-02-20T01:05)
If you have a suggestion for improving the documentation, try to be as specific as
possible when describing it. If you have found an error, please include the section
number and some of the surrounding text so we can find it easily.
Sign Up for Support
If you have an edition of Red Hat Linux 9, please remember to sign up for the benefits
you are entitled to as a Red Hat customer.
You will be entitled to any or all of the following benefits, depending upon the Red Hat
Linux product you purchased:
Red Hat support — Get help with your installation questions from Red Hat, Inc.’s
support team.
Red Hat Network — Easily update your packages and receive security notices that are
customized for your system. Go to [Link] for more details.
Under the Brim: The Red Hat E-Newsletter — Every month, get the latest news and
product information directly from Red Hat.
To sign up, go to [Link] You will find
your Product ID on a black, red, and white card in your Red Hat Linux box.
To read more about technical support for Red Hat Linux, refer to the Getting Technical
Support Appendix in the Red Hat Linux Installation Guide.
Good luck, and thank you for choosing Red Hat Linux!
The Red Hat Documentation Team
xxii
[Link]
Chapter 1.
Steps to Get You Started
From booting up to shutting down, whether you are working or playing, Red Hat Linux
provides tools and applications to help you get the most out of your computing
environment. This chapter guides you through some basic tasks that you can perform on
your Red Hat Linux system.
1.1. Setup Agent
The first time you start your Red Hat Linux system, the Setup Agent is presented. The
Setup Agent guides you through the configuration of your Red Hat Linux system. Using
this tool, you can set your system time and date, add users to your system, install
software, register your machine with the Red Hat Network, and more. Setup Agent allows
you to configure your environment at the beginning, so that you can get started using
your Red Hat Linux system quickly.
...
...
...
to use. Once you have set your time and date, click to continue.
...
3
...
...
Note
If you are installing a package from the Red Hat Linux Installation CDs, you must
insert CD 1, click the button, choose the package(s) or
component you want to install, and, if prompted, change the CD.
...
Note
Red Hat Linux applications and files are case sensitive, which means that typing
root refers to a different account than Root. By default, root refers to the
root user (also known as the superuser), or system administrator.
If you have already created and logged in to a user account, you can skip ahead to
Chapter 2 Using the Graphical Desktop. If you created only the root account, refer to
Section 1.6 Creating a User Account to learn how to set up a user account.
If you did not create a user account using the Setup Agent, you must log in as root. After
you create a user account, it is highly recommended that you log in as that user instead of
root to prevent accidental damage to your Red Hat Linux installation.
7
Caution
Because your Red Hat Linux system creates the root account during installation,
some new users are tempted to use only this account for all of their activities. This
is a dangerous idea, because the root account is allowed to do anything on the
system. You can easily damage your system by accidentally deleting or modifying
sensitive system files. You may be tempted to forego creating and using a user
account during or after installation, but it is not recommended.
1.3.1. Graphical Login
When your system has booted, a graphical login screen is displayed as shown in Figure
1-8. Again, unless you have chosen to give your machine its own hostname, which is
primarily used in a network setting, your machine will probably be called localhost.
...
...
...
should appear by default. For most users, you can accept the defaults for the other
configuration options. Refer to Ch 25 User and Group Configuration pp 222-230,
25.5 Command Line Configuration pp 226-230,
25.5 useradd Command Line Options Adding a User Table 25-1 p 227
Red Hat Linux Customization Guide for details about additional options.
6. Click OK. The new user will appear in the user list, signaling that the user account
creation is complete.
To create a user account from a shell prompt:
1. Open a shell prompt.
2. If you are not logged in as root,
type the command su - and enter the root password.
3. Type useradd followed by a space and the username for the new account you
are creating at the command line (for example, useradd jsmith). Press
[Enter]. Often, usernames are variations on the user’s name, such as jsmith
for John Smith. User account names can be anything from the user’s name, initials,
or birthplace to something more creative.
4. Type passwd followed by a space and the username again (for example,
passwd jsmith).
5. At the New password: prompt enter a password for the new user and
press [Enter].
6. At the Retype new password: prompt, enter the same password to confirm your
selection.
Important
You should take precautions when you choose a password. The password is the
key to your account, so it should be both unique and easy for you to remember.
Your password should be at least six characters. You can use both uppercase
and lowercase letters, as well as numbers and characters. Avoid easy selections,
such as qwerty or password. If you want to pick an easy-to-remember but
somewhat unique password, consider a variation of a word, such as
a1rPl4nE for airplane.
1.7. Documentation and Help
There are several resources available to get the information you need to use and
configure your Red Hat Linux system. Along with the Red Hat Linux documentation there
are manual pages, documents that detail usage of important applications and files;
12
INFO pages which break information about an application down by context-sensitive
menus; and help files that are included in the main menubar of graphical applications.
You can choose any method of accessing documentation that best suits your needs,
as all of these resources are either already installed on your Red Hat Linux system or can
be easily installed.
1.7.1. Manual Pages
Applications, utilities, and shell prompt commands usually have corresponding manual
pages (also called man pages) that show the reader available options and values of file or
executable. Man Pages are structured in such a way that users can quickly scan the page
for pertinent information, which is important when dealing with commands that they
have never previously encountered.
[Link]. Using man
Man Pages can be accessed via shell prompt by typing the command man and the
name of the executable. For example, to access the man page for the ls command,
type the following:
man ls
The field shows the executable’s name and a brief explanation of what
function the executable performs. The field shows the common
usage of the executable, such as what options are declared and what types of input
(such as files or values) the executable supports. The field
shows available options and values associated with a file or executable. See Also shows
related terms, files, and programs.
13
Chapter 2.
Using the Graphical Desktop
Red Hat Linux includes a powerful graphical desktop environment where
you can easily access your applications, files, and system resources. Both
new and experienced users will be able to take full advantage of their
Red Hat Linux systems using the graphical desktop.
This chapter covers the fundamentals of the desktop and how you can
configure it for your needs.
2.1. Using the Desktop
Your first view of the graphical desktop will look
something like
Figure 2-1.
The menu systems can be found by clicking on the Main Menu button .
Warning
If you cannot see any of the notification icons, then the notification area was
removed from the desktop panel. To add the it back to your panel, right-click on
the panel and choose Add to Panel => Utility => Notification Area.
20
Tip
Another quick and easy way to add a launcher to the panel is to right-click on an
unused area of the panel and choose Add to Panel => Launcher from menu. Then
select an application that appears in the menu. This will automatically
add a launcher icon based on the properties of the item in the Main Menu.
2.2.5. Configuring the Desktop Panel
You can hide the panel automatically or manually, place it on any edge of your desktop,
change its size and color, and change the way it behaves. To alter the default panel
settings, right-click in an unused area of the panel and select Properties. You can set the
size of the panel, its position on the desktop, and whether you want the panel to be
automatically hidden (Autohide) when not in use. If you choose to autohide the panel, it
will not appear on the desktop until you move your mouse pointer over the panel area
(called hovering).
2.3. Using Nautilus
The graphical desktop includes a file manager called Nautilus that gives you a graphical
display of your system and personal files. Nautilus is designed to be much more than a
visual listing of files, however. It allows you to configure your desktop, configure your
Red Hat Linux system, browse your photo collection, access your network resources, and
more all from one integrated interface. In essence, Nautilus becomes a shell for your
entire desktop experience.
21
Working in Nautilus is efficient and provides an alternative to searching through the
various submenus connected to the Main Menu or using a shell prompt to
navigate the file system. The following sections explain how to use the Nautilus to
enhance your desktop experience.
To start Nautilus as a file manager, double-click on your home directory icon:
Once Nautilus appears, you can navigate through your home directory or the rest of the
file system. To return to your home directory, click the Home button.
The browser window contains folders and files which you can drag with your mouse to
move and copy into new locations. You can open another Nautilus window by selecting
File => New Window. Once you have another Nautilus window, you can drag and drop
files to different directories. By default, dragging a file from one directory to another
moves the file. To copy the file to another directory, press the [Ctrl] key while
dragging and dropping the file.
By default, image files in your home directory will be seen as thumbnails. For text files,
this means you see a portion of the actual text in the icon. For images, you see a
scaled-down (or thumbnail) version of the image. To turn off this feature, select
Edit => Preferences. Select the Preview tab, then select Never in the drop down for
Show Thumbnails. Disabling this (and other) previewing feature increases the speed of
Nautilus.
2.4. Start Here
Tip
You can add your favorite locations to the Bookmarks. Navigate to the location
you want to bookmark, and then select Bookmarks => Add Bookmark.
2.4.1. Customizing the Desktop
From the Start Here screen, you can select the Preferences icon to configure your
desktop, which presents you with a wide selection of configuration options. The following
lists some of the options and tools in each area.
Background
You can configure your background with new colors or a new image. To learn more
about configuring your desktop background,
refer to Section [Link] Changing your Desktop Background.
Sound
In this section you can configure the system sounds associated with various
functions. For example, to play a sound when you log in to your desktop, you can
configure it.
Keyboard Shortcuts
You can configure shortcuts — pressing a combination of keystrokes on the
keyboard — to perform actions within an application or on your desktop. For
example, you can configure a shortcut to move from your current Workspace to
Workspace 2 by pressing [Ctrl]-[F2].
[Link]. Changing your Desktop Background
One way to dramatically alter the appearance of your graphical desktop is to change the
background using the Background Preferences tool. You can choose from several
background images included with Red Hat Linux in the
/usr/share/backgrounds/ directory, or you can use your own image. To start
the Background Preferences tool, right-click on the desktop and choose Change Desktop
Background from the menu. You can also double-click the Start Here icon, select
Preferences, and finally select Background.
23
Chapter 3.
Configuring the Date and Time
The Time and Date Properties Tool allows the user to change the system date and time,
to configure the time zone used by the system, and to setup the Network Time Protocol
(NTP) daemon to synchronize the system clock with a time server.
You must be running the X Window System and have root privileges. To start the
application from the desktop go to the Main Menu Button => System Settings =>
Date & Time or type the command redhat-config-date at a shell prompt (for
example, in an XTerm or a GNOME terminal).
3.1. Time and Date Properties
As shown in Figure 3-1, the first tabbed window that appears is for configuring the system
date and time and the NTP daemon (ntpd).
Chapter 4.
Diskettes and CD-ROMs
Using diskettes and CD-ROMs with Red Hat Linux requires some understanding about
removable media. This chapter discusses how to read and write files to and from
diskettes, how to format diskettes, and how to read and copy data from a CD-ROM. This
chapter also covers using CD-writable and CD-rewritable drives.
4.1. Using Diskettes
Diskettes are one of the oldest removable media solutions available for the personal
computer (PC). Diskettes are ideal as a portable storage solution for small files that need
to be physically moved around. For example, if two PCs are not on the same network,
diskettes are a great solution to transfer files from one computer to the other.
4.1.1. Mounting and Unmounting a Diskette
A diskette must first be mounted before it can be used. To mount a diskette, insert it into
the diskette drive and type mount /mnt/floppy/ at a shell prompt.
The diskette drive activity light should blink as the diskette’s file system is mounted to the
/mnt/floppy/ directory.
You can access the contents of the diskette by changing into that directory with the
cd /mnt/floppy/ command.
Alternatively, you can also mount a diskette by right-clicking on the desktop and choosing
Disks => Floppy. This mounts the diskette and adds a desktop icon which you can
double-click to explore the diskette contents.
Now that the diskette has been mounted it is available to be copied from or written to.
You can open, save, and copy files to/from it as you would normally do to your hard drive.
You can even explore the diskette’s contents in Nautilus (as shown in Figure 4-1) or
Konqueror.
31
Warning
Formatting a diskette will erase all of its contents. Be sure to backup any files that
you need before performing any of the following operations on your diskettes.
Once you have created an ext2 file system on the diskette, you can manipulate its
contents in the same ways that you manipulate directories and files on your hard drive.
32
[Link]. Using gfloppy
To start gfloppy, choose Main Menu => System Tools => Floppy Formatter. From a
shell prompt, type
/usr/bin/gfloppy. As shown
in Figure 4-2, the gfloppy
interface is small and has few
options. The default settings are
sufficient for most users and
needs; however, you can format
your diskette with an MS-DOS file
system type if necessary. You can
also choose the density of your
diskette (if you are not using the
usual high density 3.5" 1.44MB
diskette). You can also elect to
quick format the diskette if it was
previously formatted as ext2.
Figure 4-2. gfloppy
Insert a diskette and change the settings in gfloppy to suit your needs;
then click Format .
button in the
CD Creator
window, which
displays a dialog
box where you can
select the
writing speed ,
name the CD ,
and choose other options. Figure 4-6. The CD Creator Write Dialog Box
Click the Write files to CD button to start burning. A status
window displays the writing progress, as shown in Figure 4-7.
X-CD-Roast is well-documented
within the interface itself, as several
of the options have long, descriptive
pop-up tips that informs you of the
associated function in detail. You can
access these tooltips by leaving your
mouse pointer on a button or drop-
down menu for at least two seconds.
Play Audio-Tracks.
where you can configure the speed at which you read and write the tracks to CD-R(W),
as well as whether
you wish to
copy the CD-ROM on-the-fly
or
...
hard drive partition using Create CD. This facility allows you to add files and directories
into a CD session using Master Tracks. There are other
options within the Master Tracks dialog that allows you to
configure advanced settings; however, the defaults are set
correctly to create data CD-ROMs, so no further configuration is necessary. Figure 4-10
In the Layout Tracks tab, highlight the image file you created in the box on the right, and
click Add.
The image displays in the Tracks to write box on the left side.
Click Accept track layout, and
click the Write Tracks tab
to return to the main writing
dialog.
Tip
You can also create and write the image to the CD-R(W) in one step by clicking
Master and write on-the-fly
in the Create session image tab.
This saves a few steps but can sometimes cause read-write errors.
It is recommended that you use the multi-step method instead of the on-the-fly
methods.
[Link]. Writing ISOs with X-CD-Roast
Large files that end in .iso are known as ISO9660 (or ISO) image files. For
example, Red Hat Linux is freely available as ISO images that you can download and
write to the
CD-R(W). There are also other ISO image files available on FTP and websites. There are
other file types that can be burned as images, such as .img and .raw, but
ISO images are the most common CD image format.
41
To write an ISO image file to a CD-R(W) with X-CD-Roast, move the ISO file to the path
specified during setup, then click Create CD. In the Layout tracks tab, highlight the
ISO image file you wish to burn and click Add ,
then Accept track layout.
This automatically loads the Write Tracks tab, where you
can click Write Tracks to burn the image to the CD-R(W).
Chapter 5.
Getting Online
Exploring the Internet has become a popular activity. People use the Internet for
everything from information to finances to getting medical prescriptions on the Web.
However, in order to use the Internet, you must have a connection to it. There are many
types of Internet connections, including:
ISDN Connection Modem Connection Wireless Connection
xDSL Connection Ethernet Connections
Red Hat Linux includes the Internet Configuration Wizard, which can be used to create an
Internet connection. You can then configure the connection that you created at any time
using the Network Administration Tool. More information about the
Network Administration Tool can be found in chapter 12 Network Configuration
pp 92-114, 12.12 Working with Profiles pp 96-8 in the Red Hat Linux Customization Guide.
To use Internet Configuration Wizard, you must be running the X Window System and
have root privileges. To start the application, use one of the following methods:
In the graphical desktop environment, go to the
Main Menu => System Tools => Internet Configuration Wizard.
At a shell prompt, type the command internet-druid In both cases you will have
to enter your root password to continue.
Your own ISP ATT may have specific connection requirements for their service which
differ from the instructions in this chapter. Before connecting, check with your ISP for any
specific instructions that they provide, including the following information:
The phone number that your modem must dial to connect to your ISP if you are using a
modem.
Your login name and password for your account if you are using an xDSL or modem
connection.
A gateway address. Some ISPs may require you to configure a master address (called
the gateway) that authenticates your computer and allows it to connect to the Internet.
DNS entries: DNS means Domain Name System. DNS servers act as a road map for the
Internet. When you use the Internet, the DNS tells your machine where to send its
traffic. DNS tracks IP (Internet Protocol) addresses; each computer connected to the
Internet must have an IP address, which is a unique set of numbers like
2xx.2xx.2x.2. You may receive one or more DNS entries from your Internet
provider when you sign up.
45
Chapter 6.
Web Browsing
Once you have configured your Internet connection (see Chapter 5 Getting Online), you
are ready to get online. Red Hat Linux comes with several Web browsers, graphical
applications that use your Internet connection to access the World Wide Web: news,
research, shopping, banking, and more. This chapter briefly explains how to surf the Web
using Mozilla and Galeon. For information about using the Konqueror Web browser,
refer to Section A.6 Browsing the Web with Konqueror.
6.1. Mozilla
Part of the [Link] organization’s wide range of Open Source Internet
application developments, Mozilla is a powerful, integrated, and standards-compliant
Web browser, email client, news reader, and more. The Web browsing component
displays Web content such as webpages and images. Mozilla also uses plug-ins for
interactive multimedia such as streaming video and Web animation. This section shows
you how to use the Mozilla Web browser to explore the Internet.
To start Mozilla click the Mozilla Web Browser launcher on the panel or choose
Main Menu => Internet => Mozilla Web Browser.
Finally, there is the Personal Toolbar, which you can customize with your own bookmarks
or quickly go back to your homepage. The Personal Toolbar is useful for keeping and
categorizing webpages so that you do not have to type the address every time
you want to access the page. To add a site to your Personal Toolbar, click and
hold the left mouse
button on the small icon next to the URL in the address field and drag it directly
to the Personal Toolbar or into a folder icon .
You can access Personal Toolbar folders by clicking the icon and choosing the website
from the drop-down menu.
Mozilla also allows you to browse multiple websites within one browser window using
navigational tabs. Instead of using two or more separate windows to read multiple
webpages, you can open a tab by clicking File => New => Navigation Tab or by pressing
[Ctrl] and [T] at the same time. This will open the new tab and allow you to switch
between tabs by clicking on them. To close a tab, right-click on the tab and choose
Close Tab from the menu or click the X at the right of the tab bar to close the tab
currently displayed.
For additional information on using Mozilla, click on Help (on the top menu panel) and
then on Help Contents.
6.1.2. Mozilla Composer
You can use Mozilla Composer to create webpages. You do not need to know HTML to
use this tool. To open Composer, go to Window => Composer on the Mozilla main menu,
or click on the Composer icon in the lower left part of the screen: .
The Mozilla help files provide information on creating webpages with Composer.
Go to Help on the main menu and select Help Contents. When the help screen opens,
click on the Contents tab and expand the Creating Webpages menu by clicking on the
arrow next to it. A list of topics will appear and clicking on any of these will provide you
with information for creating and editing webpages using Mozilla Composer.
47
...
Chapter 7.
Email Applications
Email is a very popular way of communicating with others over the Internet. You can use
email with an email client, an application that understands the various email transmission
standards and allows you to send, receive, and read email. Red Hat Linux includes several
email applications, including graphical email clients like Evolution and Mozilla Mail, and
text-based clients like mutt. All of the email client applications are designed to suit
certain types of users; so, you can choose one with the features that best suits your
particular needs.
The purpose of this chapter is to demonstrate how to use some of the popular email
applications included in Red Hat Linux. Since all email clients perform the same basic tasks
(send and receive email), choose the one that is most convenient and easy to use. This
chapter will briefly discuss the following email clients:
Evolution Mozilla Mail Text-based email clients
Before you launch an email client, you should have some information from your
Internet Service Provider (ISP) handy so that you can configure the client properly. The
following lists a few important things you may need to know:
Your email address
The email address you will use to send and receive mail. This is usually in the form of
yourname@[Link].
Server type for receiving email (POP or IMAP)
In order to receive mail, you must know what type of server your network
administrator or ISP is using. This POP or IMAP address, is usually in the form of
[Link].
POP, short for Post Office Protocol, is used to send email from a mail server to your
email client’s inbox, the place where incoming email is stored. Most ISP email servers
use the POP protocol, although some can use the newer IMAP (Internet Message
Access Protocol).
IMAP, short for Internet Message Access Protocol, is a protocol for retrieving email
messages from your ISP’s email server. IMAP differs from POP in that email from
IMAP servers are stored on the server and stays there even as you download and
read your mail, whereas POP mail is downloaded to your email client directly and
does not stay on the server.
49
Server type for sending email (SMTP)
The Simple Mail Transfer Protocol (SMTP) is a protocol for sending email messages
between servers. Most email systems that send mail over the Internet use SMTP to
send messages from one server to another; the messages can then be retrieved with
an email client using either POP or IMAP. SMTP is also used to send messages from a
mail client to a mail server. This is why you need to specify both the POP or IMAP
server and the SMTP server when you configure your email application.
If you have any questions regarding what information you need, contact your ISP or
network administrator. Unless properly configured, you will not be able to make full use
of the email clients discussed in this chapter.
7.1. Evolution
Evolution is more than just an email client. It provides all of the standard email client
features, including powerful mailbox management, user-defined filters, and quick
searches. It additionally features a flexible calendar/scheduler which allows users to
create and confirm group meetings and special events online. Evolution is a full-featured
personal and workgroup information management tool for Linux and UNIX-based
systems, and is the default email client for Red Hat Linux.
To launch Evolution from the desktop panel, go to Main Menu => Internet => Email.
...
...
...
Chapter 8.
Printer Configuration
Most computer users either own a printer at home or use one at work. Printers have
become a very popular PC peripheral due to their increasing quality and decreasing
prices. Printer hardware manufacturers distribute CD-ROMs or diskettes with their
printers, as most operating systems require these CD-ROMs because they contain printer
drivers — software that communicates with both the printer and the operating system.
Red Hat Linux provides drivers for most printer models, thus the drivers and software on
the printer manufacturer’s CD-ROM and diskettes are not needed. With few exceptions,
all you need to do is attach the printer to your Red Hat Linux system, turn on the printer,
and configure it with the useful tools provided by Red Hat Linux.
8.1. The Printer Configuration Tool
Red Hat Linux includes a graphical utility for configuring local and remote printers without
the need to install additional drivers and applications. The Printer Configuration Tool
uses a step-by-step process that can help you configure a printer faster than editing
configuration files manually. This chapter shows you how to set up and test a printer
directly connected to your Red Hat Linux system. For remote printer setup and more
advanced printer configuration issues, refer to chapter 27 Printer Configuration pp 242-64
in Red Hat Linux Customization Guide.
8.2. Adding a Local Printer
To add a local printer, such as one attached through a parallel port or USB port on your
computer, click the New button in the main Printer Configuration Tool window to display
the window in Figure 8-1. Click Forward to proceed.
Tip
You can select a different print driver after adding a printer by starting the Printer
Configuration Tool, selecting the printer from the list, clicking Edit, clicking the
Driver tab, selecting a different print driver, and then applying the changes.
8.3.1. Confirming Printer Configuration
The last step is to confirm your printer configuration. Click Apply to add the print queue if
the settings are correct. Click Back to modify the printer configuration.
Click the Apply button in the main window to save your changes and restart the printer
daemon. After applying the changes, print a test page to ensure the configuration is
correct. Refer to Section 8.4 Printing a Test Page for details.
If you need to print characters beyond the basic ASCII set (including those used for
languages such as Japanese), you must review your driver options and select Prerender
Postscript. Refer to Section 8.5 Modifying Existing Printers for details. You can also
configure options such as paper size if you edit the print queue after adding it.
8.4. Printing a Test Page
After you have configured your printer, you should print a test page to make sure the
printer is functioning properly. To print a test page, select the printer that you want to try
out from the printer list, then select the appropriate test page from the Test pulldown
menu.
If you change the print driver or modify the driver options, you should print a test page to
test the different configuration.
60
...
...
...
Chapter 9.
Working with Documents
Red Hat Linux includes several tools for managing all of your documents. Whether you are
preparing for a business or school presentation, writing a formal letter, or opening a
document from an email attachment, Red Hat Linux has a tool that suits your needs.
9.1. The [Link] Suite
Productivity suites are collections of applications designed to save time and assist users at
work, at school, and at home. Usually, productivity suites are graphical and include such
applications as word processors, spreadsheets, and presentation utilities. The applications
that comprise a productivity suite are integrated — which means that you can, for
example, write a document with an embedded chart created by the spreadsheet
application as well as a slide from a graphical presentation application. Integration of the
software that make up a productivity suite helps you to give impact to your presentations,
lectures, or printed collateral.
Red Hat Linux includes a powerful business productivity suite called [Link],
which incorporates several complementary applications into one integrated package.
Using [Link] is much faster and easier than learning complex tags and code
to format your documents and presentations. It allows you complete control over the
layout and content of your documents and lets you see the results as you edit it. This real-
time, visual form of document formatting is called
what you see is what you get (or WYSIWYG) editing.
9.1.1. [Link] Features
The [Link] suite contains several applications for creating and editing
documents, spreadsheets, business presentations, and artwork. It includes templates,
forms, and wizards for creating basic professional documents and presentations quickly. If
you have ever worked with or received .doc or .xls files, you know they are
commonly associated with the Microsoft Office suite. The [Link] suite is
able to read, edit, and create files in several formats, including files which are commonly
associated with Microsoft Office. Table 9-1 shows the many different types of files you
can use and tasks you can accomplish with the [Link] suite.
75
Application File Compatibility Document Types
OpenOffice.o .sxw, .sdw, .doc, Formal letters, business forms,
rg .rtf, .txt, school papers, resumes,
Writer .htm/.html newsletters, reports
OpenOffice.o .sxc, .dbf, .xls, Spreadsheets, charts,
rg .sdc, .slk, .csv, tables, graphs, personnel
Calc .htm/.html directories, address books,
budgets, simple databases
OpenOffice.o .sxi, .ppt, .sxd, .sdd Business and academic
rg presentations,
Impress Web presentations,
lectures, slide shows
OpenOffice.o .sxd, .sda; export files to Illustrations, line drawings,
rg several image formats, including clip art,
Draw .jpg, .bmp, .gif, and .png organizational charts
Table 9-1. [Link] Features
As you can see, the [Link] suite has many file compatibility features, and
allows you to accomplish several tasks for academic, business, or home use. The following
sections shows you how to use the [Link] suite.
9.1.2. [Link] Writer
Writing documents using [Link] is similar to other word processing
applications you may have used before. A word processor is like a text editor but has
several additional features that allow you to format, design, and print your documents
without the need to memorize complex formatting tags or codes.
[Link] Writer is a powerful word processor that features WYSIWYG
formatting — what you see in the [Link] Writer window is exactly what
you get if you printed the document or if you gave the document file to someone else for
them to view. Figure 9-1 shows [Link] Writer in action:
...
76
...
...
Note
gedit can only be used in a graphica desktop environment.
84
...
gedit immediately or click the button to locate the plain text file you
want
to edit. The file will load into the main editing area as shown in Figure 9-8. You can
navigate the text file by clicking and holding the scroll bar on the right edge of the
window and moving your mouse cursor up and down; or, use the arrow keys to navigate
through the text file line-by-line. Press the [Page Up] and [Page Down] keys to
advance the document a page at a time.
Tip
gedit allows you to open multiple text files in one window using separate tabs
for each file. If you have a file already open and want to copy text from another
file, click , choose the file you want to access, and the file will open
in a new tab within the gedit window. You can navigate between each file by
clicking on the the tab associated with the particular filename.
Once you have modified or written your text file, you can save it by pressing the Save
button in the toolbar, or by choosing File => Save from the file menus. If you are writing a
new text file, a pop-up window will prompt you to name the file and save it in the
directory of your choice. If you are editing an existing file, then any changes you make will
automatically appear in the file the next time you open it. You can also choose
File => Save As... to save an existing file under a new name or in a different location,
which is convenient if, for example, you are editing a configuration file and you want to
test your changes without losing your original configuration.
For more information about gedit, choose Help => Contents from the file menus to
access the gedit manual.
9.2.1. Shell Prompt Text Editors
If you are not using a graphical desktop and want to read and modify a text or
configuration file, Red Hat Linux includes the vi (pronounced vee-eye) text editor. vi
is a simple application that opens within the shell prompt and allows you to view, search,
and modify text files. To start vi, type vi at a shell prompt. To open a file with vi
type vi <filename> at a shell prompt.
85
...
Figure 9-9. vi
By default, vi opens a file in Normal mode, meaning that you can view and run built-in
commands on the file but you cannot add text to it. To add text, press [i] (for Insert
mode), which will allow you to make any modifications you need to. To exit insert mode,
press [Esc], and vi reverts to Normal mode.
To exit vi, press [:] (which is the vi command mode) and press [q] then
[Enter]. If you have made changes to the text file that you want to save, press [:]
and type [w] then [q] to write your changes to the file and exit the application. If
you accidentally made changes to a file and you want to exit vi without saving the
changes, type [:] and then type [q] followed by [!], which exits without saving
changes.
More information about using vi can be found by typing man vi at a shell prompt.
9.3. Viewing PDFs
A PDF (Portable Document Format) file is an electronic image of a document. PDF
captures formatting information from a variety of desktop publishing applications, making
it possible to send formatted documents and have them appear on the recipient’s
monitor or printer as they were intended. To view a PDF you must have a PDF reader.
An open source application called xpdf is included with Red Hat Linux. The xpdf
toolbar at the bottom has navigational tools that let you move backward and forward
through the PDF document, as well as standard zoom, print, and find tools. The xpdf
man page provides useful information on the xpdf options. To view the xpdf man
page, at a shell prompt type man xpdf.
86
Chapter 10.
Audio, Video, and General Amusement
This chapter presents you with the lighter side of Red Hat Linux. From games and toys to
multimedia applications, Red Hat Linux provides many packages to assist you in having
some fun with your computer.
10.1. Playing Audio CDs
To play an audio CD, place the CD in your CD-ROM drive. The CD Player application should
appear automatically and begin playing the first audio track. If the interface does not
appear, click Main Menu => Sound & Video => CD Player to launch the CD Player
application.
...
89
Note
Most sound cards are supported by Red Hat Linux, but there are some sound
cards that are not completely compatible or may not work at all. If you are having
trouble configuring your sound card, check the Hardware Compatibility List at
[Link] to see if your card is supported.
The Sound Card Configuration Tool utility probes your system for sound cards. If the
utility detects a plug and play sound card, it will automatically try to configure the correct
settings for your card. You can then click the Play test sound button to play a sound
sample. If you can hear the sample, select OK and your sound card configuration is
complete.
Note
The X Configuration Tool backs up your system’s original video configuration file
to /etc/X11/[Link] in case you need it to switch back to a
previous configuration.
To run the X Configuration Tool, click Main Menu => System Settings => Display. A
pop-up window prompts you for your root password. You can also start from a shell
prompt by typing the command redhat-config-xfree86, which then prompt you
to input your root password. If you are working from a shell prompt and X is not working,
redhat-config-xfree86 attempts to start a minimal X session to allow you to
continue your configuration. Follow the instructions that appear on the screen.
X Configuration Tool attempts to automatically configure your video card and monitor
settings for you. Figure 10-6 shows the tab for configuring
your video device manually.
To configure your monitor manually, click the tab,
then click the button next
to the entry.
93
Chapter 11.
Working with Images
Digital images have grown in popularity with the development of the graphical Internet
and the increasing quality of digital cameras. There are several types of image files,
some of which are created using sophisticated illustration software packages, while
others are made from digital sources such as a scanner or camera. You may have
downloaded some of these image files from the Web or received them in an email. You
may also want to create your own images to send to others. You can view and modify
the most common types of image files using the many applications included in Red
Hat Linux.
11.1. Viewing Images
This section discusses some of the common tools for viewing image files. Certain tools
included in Red Hat Linux are specialized applications with several functions that enhance
your image viewing experience; while others are general-purpose file managers that have
integrated image viewing functionality.
11.1.1. Using Nautilus to View Images
Nautilus is a general-purpose file manager and browser for your graphical desktop
environment. Nautilus has many functions beyond simple image viewing; however, for
this section, we will use it for basic image browsing. For more information about Nautilus,
see Chapter 2 Using the Graphical Desktop.
Nautilus is known for its ease-of-use and it handles images with the same ease as it does
for other file types. To begin browsing your image collection with Nautilus,
You will be presented with a view of all files and folders within your home directory.
Double-click the image (or the folder containing the image) and Nautilus will open the file
or folder within its browser window. Figure 11-1 shows that Nautilus automatically
creates thumbnails of any images in your folders:
89
Once you have selected a file, click on the OK button to open it.
Chapter 12.
Working with Digital Cameras
Digital cameras have recently grown in popularity because of their increasing image
quality and easy interaction with desktop PCs. Digital cameras create high-quality images
that allow you to send to others over the Internet or print on a color printer.
Red Hat Linux supports several brands of digital cameras and has applications that help
you access, view, and modify your digital photographs.
12.1. Using gtKam
Red Hat Linux supports over 100 digital camera models. So, whether your camera uses
USB or serial ports to communicate with your computer, it is likely that Red Hat Linux will
support it.
gtKam is a graphical application that allows you to interface with your digital camera.
gtKam works directly with your digital camera, allowing you to open, view, save, and
delete images directly. You can also download the images to your computer and modify it
with image manipulation programs such as The GIMP (refer to
Chapter 11 Working with Images for more information about image manipulation tools).
To start gtKam gtKam, choose Main Menu => Graphics => Digital Camera Tool. You
can also start gtKam by typing gtKam at a shell prompt.
B
efore you begin using gtKam, you need to configure it to work with your digital camera.
From the menu, choose Camera => Add Camera.... From the pop-up dialog, you can
choose your camera from the drop-down list or let gtKam
automatically find your camera
by clicking Detect. Click to accept the changes and
Chapter 13.
Shell Prompt Basics
13.1. Why Use a Shell Prompt
Graphical environments for Linux have come a long way in the past few years. You can be
perfectly productive in the X Window System and only have to open a shell prompt to
complete a few tasks.
However, many Red Hat Linux functions can be completed faster from the shell prompt
than from a graphical user interface (GUI). In less time than it might take to open a file
manager, locate a directory, and then create, delete, or modify files from a GUI, a task can
be finished with just a few commands at a shell prompt.
A shell prompt looks similar to other command-line interfaces with which you might be
familiar. Users type commands at a shell prompt, the shell interprets these commands,
and then the shell tells the OS what to do. Experienced users can write shell scripts to
expand their capabilities even further.
Figure 13-2. The Command pwd Shows You Where You Are
To determine the exact location of the current directory at a shell prompt and type the
command pwd. You will see something such as:
/home/sam
This example shows that you are in the user sam’s directory,
which is in the /home directory.
The command pwd stands for print working directory. When you typed pwd, you
asked your Linux system to display your current location. Your system responded by
printing the full path of the current directory in the shell prompt window. When the
system responds to requests for information, the response is called standard output, and
can be printed to the shell prompt or can be redirected to other programs or to other
output devices such as printers.
You will find that using pwd is very helpful as you learn to navigate your Red Hat Linux
system.
13.4. Changing Directories with cd
Changing directories is easy as long as you know where you are (your current directory)
and how that relates to where you want to go.
To change directories, use the cd command. Typing this command by itself will always
return you to your home directory; moving to any other directory requires a pathname.
You can use absolute or relative pathnames. Absolute paths start at the top of the file
system with / (referred to as root) and then look down for the requested directory;
110
relative paths look down from your current directory, wherever that may be. The
following directory tree illustrates how cd operates.
/
/directory1
/directory1/directory2
/directory1/directory2/directory3
If you are currently in directory3 and you want to switch to directory1, you
need to move up in the directory tree.
Executing the command
cd directory1
while you are in directory3, will present you with an error message explaining that
there is no such directory. This is because there is no directory1 below
directory3. To move up to directory1, type: cd /directory1
This is an example of an absolute path. It tells Linux to start at the top of the directory
tree (/) and change to directory1. A path is absolute if the first character is a /.
Otherwise, it is a relative path.
Using absolute paths allows you to change to a directory from the / directory, which
requires you to know and type the complete path. Using relative paths allows you to
change to a directory relative to the directory you are currently in, which can be
convenient if you are changing to a subdirectory within your current directory.
The command cd .. tells your system to go up to the directory immediately above
the one in which you are currently working. To go up two directories, use the
cd ../.. command.
Use the following exercise to test what you have learned so far regarding absolute and
relative paths. From your home directory, type the relative path: cd ../../etc/X11
After using the full command in the example, you should be in the directory X11, which
is where you will find configuration files and directories related to the X Window System.
Take a look at your last cd command. You told your system to:
1. Go up one level to your login directory’s parent directory (probably /home)
2. Then go up to that directory’s parent (which is the root, or /, directory)
3. Then go down to the etc directory
4. Finally, go to the X11 directory
Conversely, using an absolute path would get you to the /etc/X11 directory more
quickly. For example:
cd /etc/X11
Absolute paths start from the root directory (/) and move down to the directory you
specify.
111
Note
Always make sure you know which working directory you are in before you state
the relative path to the directory or file you want to get to. You do not have to
worry about your position in the file system, though, when you state the absolute
path to another directory or file. If you are not sure, type pwd and your current
working directory will be displayed, which can be your guide for moving up and
down directories using relative pathnames.
Command Function
c returns you to your login directory
d
c ~ also returns you to your login directory
d
c / takes you to the entire system’s root directory
d
c /root takes you to the home directory of the root, or superuser,
d account created at installation; you must be the root user
to access this directory
c /home takes you to the home directory, where user login
d directories are usually stored
c .. moves you up one directory
d
c ~otheruser takes you to otheruser’s login directory, if otheruser
d has granted you permission
c /dir1/ regardless of which directory you are in, this absolute path
d subdirfoo would take you straight to subdirfoo, a subdirectory of
dir1
c ../../dir3/ this relative path would take you up two directories, then
d dir2 to dir3, then to the dir2 directory.
Table 13-1. cd Options
Now that you are starting to understand how to change directories, see what happens
when you change to root’s login directory (the superuser account). Type:
cd /root
If you are not logged in as root, you are denied permission to access that directory.
Denying access to the root and other users’ accounts (or login directories) is one way your
Linux system prevents accidental or malicious tampering. See
Section 13.14 Ownership and Permissions.
To change to the root login and root directory, use the su command.
su
112
Tip
The command su means substitute users and it allows you to log in as another
user temporarily. When you type su by itself and press [Enter], you become
root (also called the superuser) while still inside your login shell (your user’s home
directory). Typing su - makes you become root with root’s login shell; it is as if
you had logged in as root originally.
As soon as you give the root password, you will see the changes in your command prompt
to show your new, superuser status, the root account designation at the front of the
prompt and "#" at the end.
When you are done working as root, type exit at the prompt, and you will return to your
user account.
13.5. View Directory Contents with ls
Now that you know how to change directories, it is time to learn how to view the
contents of these directories. Using the ls command, you can display the contents of
your current directory.
Many options are available with the ls command. The ls command, by itself, does not
show all the files in the directory. Some files are hidden files (also called dot files) and can
only be seen with an additional option specified to the ls command.
Tip
To see all the options of the ls command, you can read the man page by
typing man ls at a shell prompt. If you want to print the man page, at the
prompt type man ls | col -b | lpr.
Type the command ls -a. Now you will see files that begin with dots.
Tip
Cron is a daemon that executes tasks at regularly scheduled intervals. To read
the cron man page, type man cron at the shell prompt. Refer to
Ch 28 Automated Tasks pp 266-72, 28.1 Cron pp 266-8
Red Hat Linux Customization Guide for more information on cron.
The cron task periodically updates the slocate database, which is used to catalog
file locations. Switching between operating systems and shutting down your machine at
the end of the day can interfere with the automatic database update run by cron.
To update the database manually, log in as root (type su at a shell prompt and then
your root password) and type the command updatedb.
After a few minutes, the slocate database that is used by the locate command
will be current.
115
Note
You can run anacron to have your system execute commands periodically,
with a frequency specified in days. Unlike cron, it does not assume that the
machine is running continuously. Hence, it can be used on machines that are not
running 24 hours a day, to control daily, weekly, and monthly jobs that are usually
controlled by cron.
Refer to the man page on anacron
(type man anacron at the command line) and
Ch 28 Automated Tasks pp 266-72, 28.1 Anacron pp 269-70
Red Hat Linux Customization Guide for more information.
13.7. Printing From The Command Line
Printing is not an involved process whether you click on a button in a GUI or type
commands from the command line. This section explains how to print, cancel, and view
print jobs from the command line, assuming you have a properly configured printer
connected to your system. Refer to Chapter 8 Printer Configuration for more information
about setting up your printer.
The lpr command, followed by a filename, sends that specified file to the print queue.
For example, lpr [Link] prints the [Link] file.
To view the jobs waiting in the print queue, type lpq at the command line. Type lpq,
and you will see information similar to this:
active root 389 [Link]
In this example, 389 is the job number.
You can cancel jobs in the queue by typing lprm followed by the print job number
displayed when you use the lpq command. To cancel the [Link] print job, type
lprm 389 and press [Enter].
13.8. Clearing and Resetting the Terminal
After even one ls command in a shell prompt, the terminal window you are working in
can begin to look crowded. You can always exit from the terminal window and open a
new one, but there is a quicker and easier way to clear the contents displayed
in the terminal.
Try typing the command clear at the shell prompt. The clear command does just
what it implies: it clears the terminal window.
Sometimes, you may accidentally open a program file or some other non-text file in a
terminal window. Once you close the file, you could find that the text you are typing does
not match the output on the monitor.
In such cases, type reset to return the terminal window to its default values.
116
Caution
Be careful when you redirect the output to a file, because you can easily overwrite
an existing file! Make sure the name of the file you are creating does not match
the name of a pre-existing file, unless you want to replace it.
Use output redirection again for another file and call it [Link]. For this example,
type the command cat > [Link], then [Enter], followed by:
bring the coffee home
take off shoes
put on sneakers
make some coffee
relax!
Now, on an empty line, use the [Ctrl]-[D] key combination again to quit cat.
Next, use cat to join [Link] with [Link] and redirect the output of
both files to a brand new file called [Link]
(you will find an example in Figure 13-7). Type the following:
cat [Link] [Link] > [Link]
118
Tip
To read startup messages more closely, at a shell prompt, type dmesg | less.
You will be able to read the file one screen at a time. Use the arrow keys to
navigate the file; to search for output, press [/] and type the search term.
Pipes can also be used to print only certain lines from a file. Type:
grep coffee [Link] | lpr
This command prints every line in the [Link] file that mentions the word
"coffee" (read more about grep in Section 13.11.3 The grep Command).
13.10.1. The more Command
The main difference between more and less is that less allows backward and
forward movement using the arrow keys, while more uses the [Spacebar] and the
[B] key for forward and backward navigation.
List the contents of the /etc directory using ls and more.
ls -al /etc | more
Tip
Unless otherwise specified, grep searches are case sensitive. That means that
searching for Coffee is different than searching for coffee. Among grep’s
options is -i, which allows for a case-insensitive search through a file.
Read the grep man page for more about this command.
123
Tip
To read more about wildcards and regular expressions, take a look at the
bash man page (man bash). Remember that you can save the file to a text file
by typing man bash | col -b [Link]. Then, you can open and read
the file with less or vi (vi [Link]). If you want to print the file, be
aware that it is quite long.
We know the file is called "sneak____.txt," so type:
ls sneak*.txt
and there is the name of the file:
[Link]
You will probably use the asterisk (*) most frequently when you are searching. The
asterisk will search out everything that matches the pattern you are looking for. So even
by typing:
ls *.txt
or:
ls sn*
You would find [Link] and any other files whose name ends with .txt or
begin with sn. It helps to narrow your search as much as possible.
One way to narrow a search is to use the question mark symbol (?). Like the asterisk,
using ? can help locate a file matching a search pattern.
124
In this case, though, ? is useful for matching a single character, so if you were searching
for sneaker?.txt, you would get [Link] as a result, and/or
[Link], if there were such a filename.
Regular expressions are more complex than the straightforward asterisk or question
mark.
When an asterisk, for example, just happens to be part of a filename, as might be the case
if the file [Link] was called sneak*.txt, that is when regular expressions
can be useful.
Using the backslash (\), you can specify that you do not want to search out everything by
using the asterisk, but you are instead looking for a file with an asterisk in the name. If the
file is called sneak*.txt, type:
sneak\*.txt
Here is a brief list of wildcards and regular expressions:
* — Matches all characters
? — Matches one character in a string
\* — Matches the * character
\? — Matches the ? character
\) — Matches the ) character
Tip
By typing the env command at a shell prompt, we can see the environment
variable that controls the size of the command line history. The line which reads,
HISTFILESIZE=500 shows the number of commands that bash will store.
125
The command line history is actually kept in a file, called .bash_history in your
login directory. We can read it in a number of ways: by using vi, cat, less, more,
and others.
Be aware that the file can be long. To read it with the more command, from your home
directory type:
more .bash_history
To move forward a screen, press [Space]; to move back a screen, press [b];
to quit, press [q].
Tip
To find a command in your history file without having to keep hitting the arrow
keys or page through the history file, use grep, a powerful search utility
(see Section 13.11.3 The grep Command. Here is how you can quickly find a
previously used command: say you are searching for a command that is similar to
cat sneak-something. You have used the command, and you think it might
be in your history file. At the shell prompt, type:
history | grep sneak
Another time-saving tool is known as command completion. If you type part of a file,
command, or pathname and then press the [Tab] key, bash will present you with
either the remaining portion of the file/path, or a beep
(if sound is enabled on your system). If you get a beep, just press [Tab] again to obtain
a list of the files/paths that match what has been typed so far.
For example, if you forget the command updatedb, but remember a portion of the
command, you can su to root, then at the shell prompt, type up, press the [Tab]
key twice and you will see a list of possible completions, including updatedb and
uptime. By typing the partial command upd and pressing [Tab] again, your
command is completed for you.
13.13. Using Multiple Commands
Linux allows you to enter multiple commands at one time. The only requirement is that
you separate the commands with a semicolon.
Suppose you have downloaded a new file called [Link], and you
want to put it in a new subdirectory within your home directory called rpms/, but the
subdirectory has not been created. You can combine both the creation of the rpms/
directory and the moving of your downloaded file into the directory by typing the
following at a shell prompt:
mkdir rpms/; mv [Link] rpms/
Running the combination of commands creates the directory and
moves the file in one line.
126
There is a lot of detail provided here. You can see who can read (r) and write to (w)
the file,
as well as who created the file (sam),
and to which group the owner belongs (sam).
Remember that, by default, the name of your
group is the same as your login name.
Caution
Remember that file permissions are a security feature. Whenever you allow
anyone else to read, write to, and execute files, you are increasing the
risk of files being tampered with, altered, or deleted. As a rule,
you should only grant read and write permissions to those who truly need them.
In the following example, you want to allow everyone to write to the file, so they can
read it, write notes in it, and save it. That means you will have to change the "others"
section of the file permissions.
Take a look at the file first. At the shell prompt, type:
ls -l [Link]
The previous command displays this file information:
- rw- rw- r-- 1 sam sam 150 Mar 19 08:08
[Link]
129
Now, type the following:
chmod o+w [Link]
The o+w command tells the system you want to give others write permission to the
file [Link]. To check the results, list the file’s details again. Now, the file looks
like this:
- rw- rw- rw- 1 sam sam 150 Mar 19 08:08
[Link]
Now, everyone can read and write to the file.
To remove read and write permissions from [Link] use the chmod
command to take away both the read and write permissions.
chmod go-rw [Link]
By typing go-rw, you are telling the system to remove read and write permissions for
the group and for others from the file [Link]. The result will look like this:
- rw- --- --- 1 sam sam 150 Mar 19 08:08
[Link]
Think of these settings as a kind of shorthand when you want to change permissions with
chmod, because all you really have to do is remember a few symbols and letters with the
chmod command.
Here is a list of what the shorthand represents:
Identities
u — the user who owns the file (that is, the owner)
g — the group to which the user belongs
o — others (not the owner or the owner’s group)
a — everyone or all (u, g, and o)
Permissions
r — read access w — write access x — execute access
Actions
+ — adds the permission - — removes the permission
= — makes it the only permission
Want to test your permissions skills? Remove all permissions from [Link] —
for everyone.
chmod a-rwx [Link]
Now, see if you can read the file with the command cat [Link], which
should return the following:
cat: [Link]: Permission denied
Removing all permissions, including your own, successfully locked the file. But since the
file belongs to you, you can always change its permissions back with the following
command: chmod u+rw [Link]
130
Use the command cat [Link] to verify that you, the file owner, can read
the file again. Here are some common examples of settings that can be used with
chmod:
g+w — adds write access for the group
o-rwx — removes all permissions for others
u+x — allows the file owner to execute the file
a+rw — allows everyone to read and write to the file
ug+r — allows the owner and group to read the file
g=rx — allows only the group to read and execute (not write)
By adding the -R option, you can change permissions for entire directory trees.
Because you can not really "execute" a directory as you would an application, when you
add or remove execute permission for a directory, you are really allowing (or denying)
permission to search through that directory.
If you do not allow others to have execute permission to tigger, it will not matter who
has read or write access. No one will be able to get into the directory unless they know
the exact file name. For example, type:
chmod a-x tigger
to remove everyone’s execute permissions.
Here is what happens now when you try to cd to into tigger: bash:
tigger: Permission denied
Next, restore your own and your group’s access:
chmod ug+x tigger
Now, if you check your work with ls -l you will see that only others will be denied
access to the tigger directory.
13.14.2. Changing Permissions With Numbers
Remember the reference to the shorthand method of chmod? Here is another way to
change permissions, although it may seem a little complex at first.
Go back to the original permissions for [Link]:
-rw-rw-r-- 1 sam sam 150 Mar 19 08:08 [Link]
Each permission setting can be represented by a numerical value:
r = 4 w = 2 x = 1 - = 0
When these values are added together, the total is used to set specific permissions. For
example, if you want read and write permissions, you would have a value of
6; 4 (read) + 2 (write) = 6.
For [Link], here are the numerical permissions settings:
- (rw-) (rw-) (r--)
| | |
4+2+0 4+2+0 4+0+0
The total for the user is six, the total for the group is six, and the total for others is four.
The permissions setting is read as 664.
131
If you want to change [Link] so those in your group will not have write
access, but can still read the file, remove the access by subtracting two (2) from that set
of numbers.
The numerical values, then, would become six, four, and four (644). To implement these
new settings, type: chmod 644 [Link]
Now verify the changes by listing the file. Type:
ls -l [Link]
The output should be:
-rw-r--r-- 1 sam sam 150 Mar 19 08:08 [Link]
Now, neither the group nor others have write permission to [Link]. To return
the group’s write access for the file, add the value of w (2) to the second set of
permissions.
chmod 664 [Link]
Warning
Setting permissions to 666 will allow everyone to read and write to a file or
directory. Setting permissions to 777 allows everyone read, write, and execute
permission. These permissions could allow tampering with sensitive files, so in
general, it is not a good idea to use these settings.
Here is a list of some common settings, numerical values and their meanings:
-rw------- (600) — Only the owner has read and write permissions.
-rw-r--r-- (644) — Only the owner has read and write permissions;
the group and others have read only.
-rwx------ (700) — Only the owner has read, write, and execute permissions.
-rwxr-xr-x (755) — The owner has read, write, and execute permissions;
the group and others have only read and execute.
-rwx--x--x (711) — The owner has read, write, and execute permissions; the
group and others have only execute.
-rw-rw-rw- (666) — Everyone can read and write to the file.
(Be careful with these permissions.)
-rwxrwxrwx (777) — Everyone can read, write, and execute.
(Again, this permissions setting can be hazardous.)
Chapter 14.
Managing Files and Directories
Your desktop file manager is a powerful and important tool for managing files and
directories using the graphical desktop. This chapter discusses various shell prompt
commands that can be used to manage files and directories on your Red Hat Linux
system. This chapter also discusses compression tools to create archives of your files for
backup or to conveniently send to others.
Note
Due to system security, unless you are root, you will not be able to gain access to
all system-level files and directories. If you do not have the permission to open,
delete, or execute a file, you will receive an error message saying your access is
denied. This is normal behavior and is used to prevent non-privileged users from
modifying or deleting important system files.
14.1. A Larger Picture of the File System
Every operating system has a method of storing data in files and directories so that it can
keep track of additions, modifications, and other changes.
In Linux, every file is stored in a directory. Directories can also contain directories; these
subdirectories can also contain files and other subdirectories.
You might think of the file system as a tree-like structure and directories as branches.
These directories may contain, or be the "parent" of, directories within it (called
subdirectories) which hold files and may contain subdirectories of their own.
There would not be a tree without a root, and the same is true for the Linux file system.
No matter how far away the directories branch, everything is connected to the root
directory, which is represented as a single forward slash (/).
Tip
Red Hat Linux uses the term root in several different ways, which might be
confusing to new users. There is the root account (the superuser, who has
permission to do anything), the root account’s home directory (/root) and
the root directory for the entire file system (/). When you are speaking to
someone and using the term root, be sure to know which root is being discussed.
Unless you are a system administrator or have root (superuser) access, you probably do
not have permission to write to the files and directories outside of your home directory.
133
Certain directories are reserved for specific purposes. For example, /home is the
default location for users’ home directories.
Users that do not have superuser access might find the following directories useful for
finding their home directories, reading documentation, or storing temporary files.
/home — Default location for users’ home directories. For example, a user with the
username foo has the home directory /home/foo.
/usr/share/doc — Location of documentation for installed packages. For
example, the documentation for the redhat-config-date software package is
located in /usr/share/doc/redhat-config-date- <version-number> .
/tmp — The reserved directory for all users to store temporary files. Files stored here
are not permanent. A system process removes old files from this directory on a periodic
basis. Do not write any files or directories that you want to keep here.
Your Red Hat Linux system is compatible with many other Linux distributions because of
the Filesystem Hierarchy Standard (FHS). The FHS guidelines help to standardize the way
system programs and files are stored on all Linux systems.
To learn more about the FHS, refer to the 3.2 Overview of File System Hierarchy Standard
(FHS) pp 28-33 Red Hat Linux Reference Guide.
You can also visit the FHS website at [Link]
14.2. Identifying and Working with File Types
If you are new to Linux, you may see certain file types that you do not recognize because
of their unfamiliar extension. A file’s extension is the last part of a file’s name after the
final dot (in the file [Link], "txt" is that file’s extension).
Here is a brief listing of file extensions and their meanings:
14.2.1. Compressed and Archived Files
.bz2 — a file compressed with bzip2
.gz — a file compressed with gzip
.tar — a file archived with tar (short for tape archive), also known as a tar file
.tbz — a tarred and bzipped file
.tgz — a tarred and gzipped file.
.zip — a file compressed with ZIP compression, commonly found in MS-DOS
applications. Most compressed files for Linux use the gzip compression, so finding a
.zip archive for Linux files is rare.
For information on working with bzip2, gzip, and tar files, refer to
Section 14.3 File Compression and Archiving.
14.2.2. File Formats
.au — an audio file .gif — a GIF image file
.html/.htm — an HTML file .jpg — a JPEG image file
.pdf — an electronic image of a document; PDF stands for Portable Document Format
.png — a PNG image file (short for Portable Network Graphic)
134
.ps — a PostScript file; formatted for printing .txt — a plain ASCII text file
.wav — an audio file .xpm — an image file
14.2.3. System Files
.conf — a configuration file. Configuration files
sometimes use the .cfg extension, as well.
.lock — a lock file; determines whether a program or device is in use
.rpm — a Red Hat Package Manager file used to install software
14.2.4. Programming and Scripting Files
.c — a C program language source code file
.cpp — a C++ program language source code file
.h — a C or C++ program language header file
.o — a program object file .pl — a Perl script
.py — a Python script .so — a library file
.sh — a shell script .tcl — a TCL script
But file extensions are not always used, or used consistently. So what happens when a file
does not have an extension, or the file does not seem to be what the extension says it is
supposed to be?
That is when the file command can be helpful.
For example, you find a file called saturday without an extension. Using the file
command, you can tell what type of file it is by typing:
file saturday
In the example, the command file saturday will display ASCII text, telling you it
is a text file. Any file that is designated as a text file should be readable by using the cat,
more, or less commands, or by using a text editor such as gedit or vi.
Tip
To learn more about file, read the man page by typing man file.
For more information on helpful commands for reading files, see
Chapter 13 Shell Prompt Basics.
14.3. File Compression and Archiving
Sometimes it is useful to store a group of files in one file so that they can be backed up,
easily transferred to another directory, or even transferred to a different computer. It is
also sometimes useful to compress files into one file so that they use less disk space and
download faster via the Internet.
It is important to understand the distinction between an archive file and a
compressed file. An archive file is a collection of files and directories that are stored
in one file. The archive file is not compressed — it uses the same amount of disk space as
135
all the individual files and directories combined. A compressed file is a collection of files
and directories that are stored in one file and stored in a way that uses less disk space
than all the individual files and directories combined. If you do not have enough disk
space on your computer, you can compress files that you do not use very often or files
that you want to save but do not use anymore. You can even create an archive file and
then compress it to save disk space.
Note
An archive file is not compressed, but a compressed file can be an archive file.
14.3.1. Using File Roller
Red Hat Linux includes a graphical utility called File Roller that can compress,
decompress, and archive files and directories. File Roller supports common UNIX and
Linux file compression and archiving formats and has a simple interface and extensive
help documentation if you need it. It is also integrated into the desktop environment and
graphical file manager to make working with archived files easier.
To start File Roller click Main Menu => Accessories => File Roller. You can also start File
Roller from a shell prompt by typing file-roller. Figure 14-1 shows File Roller in
action.
Tip
If you are using a file manager (such as Nautilus), you can double-click the file you
wish to unarchive or decompress to start File Roller. The File Roller browser
window will appear with the decompressed/unarchived file in a folder for you to
extract or browse.
136
Tip
There is much more you can do with File Roller than is explained here. Refer to
the File Roller manual (available by clicking Help => Manual) for more
information.
14.3.2. Compressing Files at the Shell Prompt
Compressed files use less disk space and download faster than large, uncompressed files.
In Red Hat Linux you can compress files
with the compression tools gzip, bzip2, or zip.
The bzip2 compression tool is recommended because it provides the most
compression and is found on most UNIX-like operating systems.
The gzip compression tool can also be found on most UNIX-like operating systems.
If you need to transfer files between Linux and other operating system such as MS
Windows, you should use zip because it is more compatible with the compression
utilities on Windows.
Compression Tool File Extension Uncompression Tool
Gzip .gz Gunzip
bzip2 .bz2 bunzip2
Zip .zip Unzip
Table 14-1. Compression Tools
By convention, files compressed with gzip are given the extension .gz,
files compressed with bzip2 are given the extension .bz2, and
files compressed with zip are given the extension .zip.
Files compressed with gzip are uncompressed with gunzip,
files compressed with bzip2 are uncompressed with bunzip2, and
files compressed with zip are uncompressed with unzip.
[Link]. Bzip2 and Bunzip2
To use bzip2 to compress a file, type the following command at a shell prompt:
bzip2 filename
The file will be compressed and saved as filename.bz2.
To expand the compressed file, type the following command:
bunzip2 filename.bz2
The filename.bz2 is deleted and replaced with filename.
You can use bzip2 to compress multiple files and directories at the same time by
listing them with a space between each one:
bzip2 filename.bz2 file1 file2 file3 /usr/work/school
139
The above command compresses file1, file2, file3, and the contents of the
/usr/work/school directory (assuming this directory exists) and places them in a
file named filename.bz2.
Tip
For more information, type man bzip2 and man bunzip2 at a shell
prompt to read the man pages for bzip2 and bunzip2.
[Link]. Gzip and Gunzip
To use gzip to compress a file, type the following command at a shell prompt:
gzip filename
The file will be compressed and saved as [Link].
To expand the compressed file, type the following command:
gunzip [Link]
The [Link] is deleted and replaced with filename.
You can use gzip to compress multiple files and directories at the same time by listing
them with a space between each one:
gzip -r [Link] file1 file2 file3 /usr/work/school
The above command compresses file1, file2, file3, and the contents of the
/usr/work/school directory (assuming this directory exists) and places them in a
file named [Link].
Tip
For more information, type man gzip and man gunzip at a shell prompt to
read the man pages for gzip and gunzip.
[Link]. Zip and Unzip
To compress a file with zip, type the following command:
zip -r [Link] filesdir
In this example, [Link] represents the file you are creating and filesdir
represents the directory you want to put in the new zip file. The -r option specifies
that you want to include all files contained in the filesdir directory recursively.
To extract the contents of a zip file, type the following command:
unzip [Link]
You can use zip to compress multiple files and directories at the same time by listing
them with a space between each one:
zip -r [Link] file1 file2 file3 /usr/work/school
140
The above command compresses file1, file2, file3, and the contents of the
/usr/work/school directory (assuming this directory exists) and places them in a
file named [Link].
Tip
For more information, type man zip and man unzip at a shell prompt to
read the man pages for zip and unzip.
14.3.3. Archiving Files at the Shell Prompt
A tar file is a collection of several files and/or directories in one file. This is a good way
to create backups and archives.
Some of the options used with the tar are:
-c — create a new archive.
-f — when used with the -c option, use the filename specified for the creation of
the tar file; when used with the -x option, unarchive the specified file.
-t — show the list of files in the tar file.
-v — show the progress of the files being archived.
-x — extract files from an archive.
-z — compress the tar file with gzip.
-j — compress the tar file with bzip2.
To create a tar file, type:
tar -cvf [Link] directory/file
In this example, [Link] represents the file you are creating and
directory/file represents the directory and file you want to put in the archived
file.
You can tar multiple files and directories at the same time by listing them with a space
between each one:
tar -cvf [Link] /home/mine/work /home/mine/school
The above command places all the files in the work and the school subdirectories
of /home/mine in a new file called [Link] in the current directory.
To list the contents of a tar file, type:
tar -tvf [Link]
To extract the contents of a tar file, type:
tar -xvf [Link]
This command does not remove the tar file, but it places copies of its unarchived
contents in the current working directory, preserving any directory structure that the
archive file used. For example, if the tarfile contains a file called [Link] within a
directory called foo/, then extracting the archive file will result in the creation of the
directory foo/ in your current working directory with the file [Link] inside of it.
141
Remember, the tar command does not compress the files by default. To create a
tarred and bzipped compressed file, use the -j option:
tar -cjvf [Link] file
tar files compressed with bzip2 are conventionally given the extension .tbz;
however, sometimes users archive their files using the tar.bz2 extension.
The above command creates an archive file and then compresses it as the file
[Link]. If you uncompress the [Link] file with the bunzip2
command, the [Link] file is removed and replaced with [Link].
You can also expand and unarchive a bziptar file in one command:
tar -xjvf [Link]
To create a tarred and gzipped compressed file, use the -z option:
tar -czvf [Link] file
tar files compressed with gzip are conventionally given the extension .tgz.
This command creates the archive file [Link] and then compresses it as the
file [Link]. (The file [Link] is not saved.) If you uncompress the
[Link] file with the gunzip command, the [Link] file is
removed and replaced with [Link].
You can expand a gziptar file in one command:
tar -xzvf [Link]
Tip
Type the command man tar for more information about the tar command.
14.4. Manipulating Files at the Shell Prompt
Files can be manipulated using one of the graphical file managers, such as Nautilus or
Konqueror. They can also be manipulated using a shell prompt, which is often faster. This
section explains how to manipulate files at the shell prompt.
14.4.1. Creating Files
You can create new files either with applications (such as text editors) or by using the
command touch, which will create an empty file that you can use to add text or data.
To create a file with touch, type the following at a shell prompt.
touch <filename>
Replace <filename> with the name of your choice. If you run a directory listing, you
can see that the file contains zero (0) bytes of information because it is an empty file.
For example, typing the command ls -l newfile at the shell prompt returns the
following output:
-rw-rw-r-- 1 sam sam 0 Apr 10 17:09 newfile
142
Tip
To learn more about relative and absolute pathnames, refer to
Section 13.4 Changing Directories with cd.
Read the cp man page (type man cp at the shell prompt) for a full list of the
options available with cp. Among the options you can use with cp are the following:
-i — interactive. Prompts you to confirm if the file is going to overwrite a file in your
destination. This is a handy option because it can help prevent you from making
mistakes.
-r — recursive. Rather than just copying all the specified files and directories, this will
copy the whole directory tree, subdirectories and all.
-v — verbose. Shows the progress of the files as they are being copied.
Now that you have the file [Link] in the tigger directory, use cp -i
to copy the file again to the same location.
cp -i [Link] tigger cp: overwrite
’tigger/[Link]’?
To overwrite the file that is already there, press [Y] and then [Enter]. If you do not
want to overwrite the file, press [N] and [Enter].
14.4.3. Moving Files
To move files, use the mv command. For more about mv, see the mv man page (type
man mv). Common options for mv include the following:
143
-i — interactive. This will prompt you if the file you have selected will overwrite an
existing file in the destination directory. This is a good option, because like the -i
option for cp, you will be given the chance to make sure you want to replace an
existing file.
-f — force. Overrides the interactive mode and moves without prompting. Unless you
know what you are doing, this option is dangerous; be very careful about using it until
you become more comfortable with your system.
-v — verbose. Shows the progress of the files as they are being moved.
If you want to move a file out of your home directory and into another existing directory,
type the following (you will need to be in your home directory):
mv [Link] tigger
Alternatively, the same command using absolute pathnames looks like
mv [Link] /home/newuser/[Link]
/home/newuser/tigger
14.4.4. Deleting Files and Directories
You learned about creating files with the touch command, and you created the
directory tigger using mkdir.
Now you need to learn how to delete files and directories. Deleting files and directories
with the rm command is a straightforward process. See the rm man page for more
information. Options for removing files and directories include:
-i — interactive. Prompts you to confirm the deletion. This option can stop you from
deleting a file by mistake.
-f — force. Overrides interactive mode and removes the file(s) without prompting.
This might not be a good idea, unless you know exactly what you are doing.
-v — verbose. Shows the progress of the files as they are being removed.
-r — recursive. Will delete a directory and all files and subdirectories it contains. To
delete the file [Link] with the rm command, type:
rm [Link]
Warning
Once a file or directory is removed with the rm command, it is gone permanently
and cannot be retrieved.
Use the -i (interactive) option to give you a second chance to think about whether or
not you really want to delete the file.
rm -i [Link]
rm: remove ’[Link]’?
You can also delete files using the wildcard *, but be careful, because you can easily
delete files you did not intend to throw away.
To remove a file using a wildcard, you would type:
rm pig*
144
The above command will remove all files in the directory which start with the letters pig.
You can also remove multiple files using the rm command. For example: rm
[Link] [Link]
You can use rmdir to remove a directory (rmdir foo, for example), but only if the
directory is empty. To remove directories with rm, you must specify the -r option.
For example, if you want to recursively remove the directory tigger you would type:
rm -r tigger
If you want to combine options, such as forcing a recursive deletion, you can type:
rm -rf tigger
A safer alternative to using rm for removing directories is the rmdir command. With
this command, you will not be allowed to use recursive deletions, so a directory which has
files in it will not be deleted.
Warning
The rm command can delete your entire file system! If you are logged in as root
and you type the simple command rm -rf /, you are in trouble; this command
will recursively remove everything on your system.
Read the rmdir man page (man rmdir) to find out more about this command.
145
146
Chapter 15.
Installing and Updating Red Hat Linux Packages
Red Hat Linux consists of various software applications and utilities, known as RPM
packages. A package is just a file that contains a software program.
This chapter explains three ways to update your system: using Red Hat Network, using
the online Errata List, and using the Red Hat Linux Installation CD-ROMs.
15.1. Red Hat Network
Red Hat Network is an Internet solution for managing one or more Red Hat Linux systems.
All Security Alerts, Bug Fix Alerts, and Enhancement Alerts (collectively known as Errata
Alerts) can be downloaded directly from Red Hat using the Red Hat Update Agent
standalone application or through the RHN website available at
[Link]
Tip
Red Hat Linux includes the Red Hat Network Notification Tool, a convenient panel
icon that displays visible alerts when there is an update for your Red Hat Linux
system. Refer to the following URL for more information about the applet:
[Link]
15.2. Errata List
It is recommended that new users use Red Hat Network to download and install/upgrade
packages. Updating Errata packages from the Red Hat Linux Errata website is
recommended for more experienced Red Hat Linux users. It also requires users to resolve
software dependencies manually. A software dependency is when a package is dependent
on other package being installed.
All Security Alerts, Bug Fix Alerts, and Enhancement Alerts (collective known as Errata
Alerts) can also be downloaded from the Red Hat website at
[Link] Click on the Red Hat Linux
version you are using to view a list of all available errata for Red Hat Linux. Click on the
name of the Errata Alert that you want to apply to your system. Instructions for updating
149
the packages are on the individual Errata pages. Red Hat, Inc. tests and approves the
RPMs posted on this site. RPMs downloaded from other sites are not supported.
For more information about installing packages downloaded from our errata sites, refer
to Section 15.4 Downloaded Packages.
15.3. Installation CD-ROMs
Place the first Red Hat Linux CD-ROM in your CD-ROM drive. Select Yes when asked if you
want to run the autorun program from the CD. It then prompts you for the root password
so that you can install packages.
If you enter the correct root password, the Package Management Tool interface appears
and allows you to select packages groups to install as well as individual packages within
the groups.
Chapter 16.
Frequently Asked Questions
This chapter answers some of the most common questions about using Red Hat Linux
that you may ask as you become more familiar with it. From recovering forgotten
passwords to troubleshooting package installation problems, this chapter will ease you
step-by-step through some common tasks and get you on your way.
16.1. Localhost Login and Password
I have installed Red Hat Linux. After rebooting, I get a message telling me it needs a
localhost login and password. What are these?
Unless you specified a host name for your computer, or received that information from a
network, your Red Hat Linux installation will call your machine
[Link] by default.
When you get to that initial prompt, it is asking you to log in to your system. If you
created a user account with the Setup Agent, you can log in using that user name and
password. If you did not create a user account, then you can log in as the super user, also
known as root. The root password is the system password you assigned during
installation.
It is highly recommended that you create at least one user account for regular use of your
Red Hat Linux system. You can create a new user after logging in as root with the
User Manager graphical tool or the useradd shell prompt utility. For more information,
refer to Section 1.6 Creating a User Account.
16.2. Error Messages During Installation of RPMs
How do I install an RPM from a CD or the Internet? I keep getting an error message
when I use rpm.
If you are getting an error message similar to
failed to open /var/lib/rpm/[Link], it is because you do not have proper
permission to install RPM files.
When you install software, you are often required to make system-wide changes which
only root can make, such as creating new directories outside of your user home directory
or making changes to your system configuration. If you are using your normal user
account, you will not have permission to make such changes by default.
You need to be the root user in order to install RPM files. At a shell prompt, switch to the
root user by running the following command:
su
153
After entering the root password when prompted, you should then be able to install the
RPM file without further errors. For more information about using RPM and
Package Management Tool, refer to the Red Hat Linux Customization Guide on the
Red Hat Linux Documentation CD or online at [Link]
16.3. Starting Applications
I installed an application I downloaded from the Internet, and everything seemed to go
fine, but I still get "command not found" when I type its name. I think I have the right
name, so why will it not start?
If you are trying to start an application from the shell prompt and it is not working, try
typing out the full directory path before the name of the application’s executable (such as
/usr/local/bin/myexecutable).
For example, imagine that you have downloaded the setiathome client application
and want to try it out. You follow the directions for installing the software, which creates
a subdirectory in your home directory called seti/. Now, start the application using the
full path to the executable file as shown below:
/home/joe/seti/setiathome
The reason you may need to type the full pathnames in order to start an application is
because the executable was not placed in a directory where your user shell environment
knew it could be found (such as /usr/local/bin).
You can customize your settings so that you are not required to use the type the full path
to the application each time. To do this, you will have to edit your PATH environment
variable.
16.3.1. Editing Your PATH
If you frequently start programs that are not located in a directory that your user shell has
been configured to search, you will have to edit your user shell configuration file to add
the directory containing the executable you wish to run. You can do this by adding the
directory to your PATH environment variable.
Caution
These instructions are intended only for user accounts. Avoid modifying files such
as the root user’s .bash_profile, because of the potential security risks.
Start a text editor, such as gedit or vi, at a shell prompt. You can open the file called
.bash_profile by typing the following: gedit .bash_profile
You will see a PATH statement, similar to the one shown below.
PATH=$PATH:$HOME/bin:/usr/local/bin:
To the end of this statement, add $HOME/seti as shown below:
PATH=$PATH:$HOME/bin:/usr/local/bin/:$HOME/seti:
154
Save the file and exit the text editor.
You can then make the changes to .bash_profile take effect immediately by typing
the following command:
source .bash_profile
By adding paths to your .bash_profile, you can place utilities and programs in your
path and be able to execute them without having to type ./ in front of the command.
Tip
For more information about using and configuring your shell prompt refer to
Chapter 13 Shell Prompt Basics.
16.4. Accessing a Windows Partition
I have a dual-boot system with Red Hat Linux and Windows 98. Is there a way to access
my Windows partition while I am running Linux?
You can access another partition on your system (for example, a Windows partition), in
two different ways.
You should first determine where your Windows partition is located by determining what
physical hard disk your Windows partition is located in (such as the primary master IDE
drive or the the first SCSI drive).
To find this information, you can use the Hardware Browser, which lists detailed
information about the hardware in your Red Hat Linux system.
To start the Hardware Browser, choose Main Menu => System Tools => Hardware
Browser. Figure 16-1 shows Hardware Browser in action.
155
Warning
Change only the number of the default runlevel from 3 to 5.
Your changed line should look like the following:
id:5:initdefault:
When you are satisfied with your change, save and exit the file using the [Ctrl]-[x]
keys. You will see a message telling you that the file has been modified, and asking you to
confirm your change. Type [Y] for yes.
Now, your next login after reboot will be from the graphical screen.
160
Appendix A.
KDE: The K Desktop Environment
A.1. Introducing KDE
The K Desktop Environment (KDE) is a graphical desktop that uses common graphical
objects such as icons, windows, menus, and panels; it allows you to access your
Red Hat Linux system and applications using your mouse and keyboard.
This appendix covers the basics of using KDE: system navigation, working with files and
applications, and customizing the desktop to suit your needs.
If you would like to learn more about KDE, visit the official website at
[Link]
A.2. Finding Help
You can access a comprehensive set of documentation about KDE through the
HelpCenter.
...
application launchers ,
status indicators ,
You can have up to 16 desktops running at the same time in KDE. The panel taskbar
Icons located on the desktop can be files, folders, device links, or application launchers.
Click on an icon to open the associated resource.
162
The KDE desktop works similarly to other graphical desktop environments. You can drag
and drop files and application icons to any location on the desktop. You can also add new
icons for all types of applications and resources to the desktop, panel, or file manager.
The desktop itself is also highly customizable. You can change the appearance of buttons,
window and frame decorations, and backgrounds. Configuration tools are also available
which allow you to customize the way the desktop behaves at events such as single- and
double-clicking mouse buttons and chording keystrokes to create time-saving shortcuts.
The default KDE desktop displays icons
and configuration tools, and a diskette icon . You can access any one of these resources
by double-clicking on the associated icon.
When you right-click on these icons, you see several options for working with these
resources, such as Delete, Rename, Move to Trash, and Copy.
You can drag and drop unwanted items such as files you no longer need
email client ,
word processor ,
...
...
...
Figure A-5. Virtual Desktop Configuration
You can change the names of your desktops (from Desktop 1, Desktop 2, etc.) by deleting
the default names and typing a new name in each desktop’s corresponding text box.
You can also change the number of desktops available to you by adjusting the slider in the
Number of Desktops. For more desktops, drag the bar to the right; for fewer desktops,
drag the bar to the left.
...
Buttons for your desktops appear on the panel in the Desktop Pager.
Tip
You can use the keyboard combination of the [Ctrl] and Function keys to
switch desktops. For example, [Ctrl]-[F2] switches to desktop two,
[Ctrl]-[F3] takes you to desktop three, and so on.
A.4.2.2. Viewing The Taskbar
The taskbar displays all running applications, both minimized and displayed, on all
desktops.
168
Tip
Another way to bring minimized or background windows to the front is to use the
[Alt] and [Tab] keys. To pick an item from the taskbar, hold down both the
[Alt]-[Tab] key. To scroll through the tasks, hold down the [Alt] key,
while tapping the [Tab] key. When you have found the task you want to
maximize and bring to the front, release both keys and the application appears on
the desktop.
A.4.3. Adding Icons and Applets to the Panel
To further customize the panel for your particular needs, you can include additional
launcher icons to start applications without using the main menu or Start Here.
To add a new launcher to the panel, right-click the panel and choose
Add => Application Button and choose the application or resource you wish to add to the
panel. This automatically adds an icon on the panel. You can move the icon anywhere you
want on the panel by right-clicking the icon and choosing Move Application Button,
where Application is the name of the application associated with the icon.
A.4.4. Configuring the KDE Panel
You can hide the panel automatically or manually, place it on any edge of your desktop,
change its size and color, and change the way it behaves. To alter the default panel
settings, right-click the panel and choose Configure Panel. The Settings window will
appear, allowing you to adjust all panel settings, or any one of the specific properties
(Arrangement, Hiding, Menus, and so on). Choose the Hiding tab,
click Hide automatically, and adjust the number of seconds to elapse before the panel is
hidden. Click Apply then OK to close the Settings
dialog. The panel will remain hidden until you hover over the panel area to make it
reappear.
169
...
...
...
Figure A-11. The Konqueror Handbook
172
.
Using Konqueror as an image browser works similarly to Nautilus
(see Chapter 11 Working with Images for more information). Image files
automatically generate thumbnail image icons for you to preview within the file browser
window. When you double-click on a thumbnail icon, the browser displays the image in
its native size, as shown in Figure A-12.
This will re-display the image and allow you to rotate and
zoom in on the image using the two magnifying glass icons
...
Figure A-13. Image viewing configuration on the Konqueror Toolbar
To compose a mail, click on the new message icon in the tool bar:
176
...
Appendix B.
Applications
The following table shows some of the Red Hat Linux applications that are available to
perform many common tasks. This is not a complete list of all applications available.
Applications in between (parentheses) denotes the formal name of the application.
Category Recommended Application Extras
Word Processors [Link] Write KWord
Spreadsheets [Link] Calc Gnumeric, KSpread
Presentations [Link] Impress KPresenter, MagicPoint
Charts and Dia Kchart, Kivio, XFig
Diagrams
Graphics The GIMP, Paint Program (KPaint) Icon Editor (K Icon Editor)
Image Viewers GThumb Image Viewer (Kuickshow),
The GIMP
Digital Digital Camera Tool (gtKam), Scan and OCR Program
Cameras/Scanners Scanning (XSane) (Kooka), The GIMP
PDAs Jpilot KPilot, Evolution
CD Recording CD Creator, cdrecord, X-CD- KOnCD
Roast
Text Editors Text Editor (gedit) vi, Emacs, Kate
Email Clients Evolution Kmail, Mozilla Mail, mutt
Web Browsers Mozilla Galeon, Konquerer,
links, lynx
Chat/Instant Instant Messenger (GAIM) X-Chat, Chatzilla
Messaging
PDF/PostScript xpdf Ghostview
Viewers
Personal Finance Gnucash
Fax Fax Viewer (KFax)
Sound Audio Player (XMMS), KDE CD Player, aumix,
CD Player (GNOME CD), KDE Sound Mixer, KMid
Sound Recorder (GNOME Sound),
Volume Monitor (VUMeter)
177
178
Appendix C.
A Comparison of Common DOS and Linux Commands
Many Linux commands typed at a shell prompt are similar to the commands you would
type in DOS. In fact, some commands are identical.
This appendix provides common commands used at the DOS prompt in Windows and
their counterparts in Linux. Basic examples of how the command are used at the Linux
shell prompt are also provided. Note that these commands usually have a number of
options. To learn more about each command, read its associated man page (for example,
type man ls at the shell prompt to read about the ls command).
Command’s MS-DOS Linux Basic Linux Example
Purpose
Copies files copy cp cp [Link]
/home/thisdirector
y
Moves files move mv mv [Link]
/home/thisdirector
y
Lists files dir ls ls
Clears screen cls clear clear
Closes shell exit exit exit
prompt
Displays or sets date date date
date
Deletes files del rm rm [Link]
"Echoes" output echo echo echo this message
to the screen
Edits files with edit gedit(a) gedit [Link]
simple text editor
Compares the fc diff diff file1 file2
contents of files
Finds a string of find grep grep this word or
text in a file phrase
[Link]
Formats a format a: mke2fs or /sbin/mke2fs
diskette (if diskette is in mformat(b) /dev/fd0 (/dev/fd0
A:) is the Linux equivalent of
A:)
179
Command’s MS-DOS Linux Basic Linux Example
Purpose
Displays command /? man(c) man command
command help
Creates a mkdir mkdir mkdir directory
directory
Views a file more less(d) less [Link]
Renames a file ren mv(e) mv [Link]
[Link]
Displays your chdir pwd pwd
location in the
file system
Changes cd pathname cd pathname cd
directories with a /directory/directo
specified path ry
(absolute path)
Changes cd .. cd .. cd ..
directories with a
relative path
Displays the time time date date
Shows amount of mem free free
RAM in use
Notes:
a. Gedit is a graphical text editor; other editors you can use in place of Gedit
include Emacs and vi.
b. This formats a disk for the DOS file system.
c. You can also use info for some commands.
d. The more pager can also be used to page through a file one screen at a time.
e. The mv command can both move a file and, if you want to rename a file in the same
directory, "move" that file to the same directory with a new name, as seen in this
example.
Table C-1. Similar Commands
180
Appendix D.
System Directories
This is a list of the primary Red Hat Linux system directories. Each directory is described
briefly. For additional directory information, refer to the
Ch 16 Network File System (NFS) pp 142-8, Ch 17 Samba pp 150-8,
Ch19 Apache HTTP Server Configuration pp 168-186,
Ch 26 Gathering System Information pp 232-240 Red Hat Linux Customization Guide and
Ch 3 File System Structure pp 26-31, Ch 4 The sysconfig Directory pp 34-47,
Ch 5 The proc File System pp 48-85, Ch10 Apache HTTP Server pp 132-16,
Ch 13 Lightweight Directory Access Protocol (LDAP) pp 212-222
Red Hat Linux Reference Guide.
• /bin/ — Used to store user commands. The directory /usr/bin/ also stores user
commands.
• /sbin/ — Location of many system commands, such as shutdown. The directory
/usr/sbin/ also contains many system commands.
• /root/ — The home directory of root, the superuser.
• /mnt/ — This directory typically contains the mount points for file systems mounted
after the system is booted. For example, the default CD-ROM mount point is
/mnt/cdrom/.
• /boot/ — Contains the kernel and other files used during system startup.
• /lost+found/ — Used by fsck to place orphaned files (files without names).
• /lib/ — Contains many library files used by programs in /bin/ and /sbin/.
The directory /usr/lib/ contains more library files for user applications.
• /dev/ — Stores device files.
• /etc/ — Contains configuration files and directories.
• /var/ — For variable (or constantly changing) files, such as log files and the printer
spool.
• /usr/ — Contains files and directories directly relating to users of the system, such as
programs and supporting library files.
• /proc/ — A virtual file system (not actually stored on the disk) that contains system
information used by certain programs.
• /initrd/ — A directory that is used to mount the [Link] image file and
load needed device modules during bootup.
181
Warning
Do not delete the /initrd/ directory. You will be unable to boot your
computer if you delete the directory and then reboot your Red Hat Linux system.
• /tmp/ — The temporary directory for users and programs. /tmp/ allows all users
on a system read and write access.
• /home/ — Default location of user home directories.
• /opt/ — Directory where optional files and programs are stored. This directory is
used mainly by third-party developers for easy installation and uninstallation of their
software packages.
182
Appendix E.
Keyboard Shortcuts
Here are a few keyboard shortcuts you can use to perform common tasks quickly. Many
more are available in addition to what is listed here. For more command line and
keyboard shortcuts, visit:
[Link]
[Ctrl] + [Alt] + [Backspace] = kills your current X session. Kills your
graphical desktop session and returns you to the login screen. Use this if the normal exit
procedure does not work.
[Ctrl] + [Alt] + [Delete] = shutdown and reboots your Red Hat Linux
system. Shuts down your current session and reboots the OS. Use only when the normal
shutdown procedure does not work.
[Ctrl] + [Alt] + [Fn] = switches screens. [Ctrl]+[Alt] + one of the
function keys displays an available screen. By default, [F1] through [F6] are shell
prompt screens and [F7] is the graphical desktop screen.
[Alt] + [Tab] = switches tasks in a graphical desktop environment. If you have
more than one application open at a time, you can use [Alt] + [Tab] to switch
among open tasks and applications.
[Ctrl] + [a] = moves cursor to the beginning of a line. This works in most text
editors and in the URL field in Mozilla.
[Ctrl] + [d] = logout of (and close) shell prompt. Use this quick shortcut instead
of typing exit or logout.
[Ctrl] + [e] = moves cursor to end of a line. This works in most text editors and
in the URL field in Mozilla.
[Ctrl] + [l] = clears the terminal. This shortcut does the same thing as typing
clear at a command line.
[Ctrl] + [u] = clears the current line. If you are working in a terminal, use this
shortcut to clear the current line from the cursor all the way to the beginning of the
line.
[Middle Mouse Button] = pastes highlighted text. Use the left mouse button to
highlight the text. Point the cursor to the spot where you want it pasted. Click the
middle mouse button to paste it. In a two mouse system, if you configured your mouse
to emulate a third mouse button, you
can click both the left and right mouse buttons simultaneously to perform a paste.
183
[Tab] = command autocomplete. Use this command when using a shell prompt.
Type the first few characters of a command or filename and then press the [Tab] key. It
will automatically complete the command or show all commands that match the
characters you typed.
[Up] and [Down] Arrow = shows command history. When using a shell prompt,
press the [up] or [down] arrow to scroll through a history of commands you have typed
from the current directory. When you see the command you want to use, press [Enter].
clear = clears the shell prompt screen. Type this command to clear all visible data
from the shell prompt screen.
exit = logout. Type this at a shell prompt to logout of the current user or root
account.
history = shows history of commands. Type this at a shell prompt to see a
numbered list of the previous 1000 commands you typed. To display a shorter list of
previously used commands, type history followed by a space and a number. For
example, history 20.
reset = refreshes the shell prompt screen. Type this at a shell prompt to refresh the
screen if characters are unclear or appear corrupt.
184
Index
A cdrecord, 31
accounts CDs, playing, 73
creating, 7 chmod, 105
appending standard output, 98 numerical settings, 108
applets clear, 96
adding to KDE panel, 140 cron, 95
adding to the panel, 16 DOS, 149
on the desktop panel, 14 finding, 130
panel in KDE, 137 grep, 101
applications head, 101
and Red Hat Linux, 147 history, 130
starting from shell prompt, 127 locate, 94
archiving files, 113 ls, 93
B keeping output from scrolling, 131
bunzip2, 115 ls -a, 93
burning CDs, 26 ls -al, 93 ls,
additional resources, 32 common options with, 94
with CD Creator, 27 multiple, 104
with cdrecord, 30 print working directory (pwd), 90
with mkisofs, 30 pwd, 90
with X-CD-Roast, 28 reset, 96
bzip2, 115 rm (See files, deleting)
C rm -r (See directories, deleting)
stringing together, 104
cat, 96
su, 92
cd, 90
tail, 101
CD-rewritable (CD-RW), 26
common user questions, 127
additional resources, 32
compressing files, 113
and CD Creator, 27
conventions document, ii
and cdrecord, 30
copying and pasting
and mkisofs, 30
text when using X, v
and X-CD-Roast, 28
creating graphics with
CD-writable (CD-R), 26
[Link] Draw, 69
additional resources, 32
creating user accounts, 7
and CD Creator, 27
and cdrecord, 30 D
and mkisofs, 30 date configuration, 21
and X-CD-Roast, 28 dateconfig (See Time and Date
Properties Tool)
185
files Nautilus, 16
archived, 112 panel, 14
archiving, 113 Start Here , 17
with File Roller, 114 using, 13
compressed, 112 workspace, 13
compressing, 113 graphical login
with File Roller, 114 changing to, 132
copying, 119 graphics GIMP, 82
copying at a shell prompt, 119 gThumb, 80
creating touch, 119 changing wallpaper with, 81
deleting, 121 gunzip, 115
deleting at a shell prompt, 119 gzip, 115
formats, 112 H
managing from shell prompt, 89 Hardware Browser, 129 help
moving, 120 with KDE finding, 135
moving at a shell prompt, 119 hidden files, 93
renaming at a shell prompt, 119 history
types of, 112 finding commands using, 130
Filesystem Hierarchy Standard, 112 I
floppy disks (See diskettes) images
formatting diskettes, 24 additional resources, 85
G manipulation, 79
games and amusements, 76 GIMP, 82
finding more online, 77 viewing, 79, 79
getting started logging in, 5 gThumb, 80
Setup Agent, 1 Konqueror, 143
GIMP, 82 Nautilus, 79
opening a file, 83 Internet configuring, 35
saving a file, 84 Internet Configuration Wizard, 35
GNOME desktop introduction, i
(See graphical desktop) IP address, 35
GNOME Print Manager, 58 K
change printer settings, 59 KDE, 135
graphical desktop, 13 Applets adding, 140
applets, 16 multiple desktops, 138
background changing, 18, 81 customizing, 146
customizing, 18 desktop, 135
logging out of, 20 desktop icons, 136
main menu, 14
187
Web browsers, 39
Konqueror, 141
Mozilla, 39
using, 39
Windows accessing on a separate partition
add line to /etc/fstab, 129
World Wide Web browsers, 39
Mozilla, 39
X
X Configuration Tool, 76
xpdf, 72
191
Colophon.
The Red Hat Linux manuals are written in DocBook SGML v4.1 format. The
HTML and PDF formats are produced using custom DSSSL stylesheets and
custom jade wrapper scripts. The DocBook SGML files are written in Emacs
with the help of PSGML mode.
Garrett LeSage created the admonition graphics (note, tip, important, caution,
and warning). They may be freely redistributed with the
Red Hat documentation.
The Red Hat Linux Product Documentation Team consists of the following
people:
Sandra A. Moore — Primary Writer/Maintainer of the
Red Hat Linux x86 Installation Guide;
Contributing Writer to the Red Hat Linux Getting Started Guide
Tammy Fox — Primary Writer/Maintainer of the
Red Hat Linux Customization Guide;
Contributing Writer to the Red Hat Linux Getting Started Guide;
Writer/Maintainer of custom DocBook stylesheets and scripts
Edward C. Bailey — Primary Writer/Maintainer of the
Red Hat Linux System Administration Primer;
Contributing Writer to the Red Hat Linux x86 Installation Guide
Johnray Fuller — Primary Writer/Maintainer of the
Red Hat Linux Reference Guide;
Co-writer/Comaintainer of the Red Hat Linux Security Guide;
Contributing Writer to the Red Hat Linux System Administration Primer
John Ha — Primary Writer/Maintainer to the
Red Hat Linux Getting Started Guide;
Co-writer/Comaintainer of the Red Hat Linux Security Guide;
Contributing Writer to the Red Hat Linux System Administration Primer