SlideShare a Scribd company logo
LPI Linux certification in a nutshell a desktop
quick reference 1st ed Edition Jeffrey Dean pdf
download
https://ebookgate.com/product/lpi-linux-certification-in-a-
nutshell-a-desktop-quick-reference-1st-ed-edition-jeffrey-dean/
Get Instant Ebook Downloads – Browse at https://ebookgate.com
Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats
J2ME in a nutshell a desktop quick reference 1st ed
Edition Kim Topley
https://ebookgate.com/product/j2me-in-a-nutshell-a-desktop-quick-
reference-1st-ed-edition-kim-topley/
PHP in a Nutshell A Desktop Quick Reference 1st Edition
Paul Hudson
https://ebookgate.com/product/php-in-a-nutshell-a-desktop-quick-
reference-1st-edition-paul-hudson/
SQL in a Nutshell A Desktop Quick Reference Guide In a
Nutshell O Reilly 3rd Edition Kevin Kline
https://ebookgate.com/product/sql-in-a-nutshell-a-desktop-quick-
reference-guide-in-a-nutshell-o-reilly-3rd-edition-kevin-kline/
Linux Kernel in a Nutshell In a Nutshell O Reilly 1st
Edition Greg Kroah-Hartman
https://ebookgate.com/product/linux-kernel-in-a-nutshell-in-a-
nutshell-o-reilly-1st-edition-greg-kroah-hartman/
MySQL in a Nutshell 1st Edition Dyer
https://ebookgate.com/product/mysql-in-a-nutshell-1st-edition-
dyer/
grep Pocket Reference A Quick Pocket Reference for a
Utility Every Unix User Needs Pocket Reference O Reilly
1st Edition Bambenek
https://ebookgate.com/product/grep-pocket-reference-a-quick-
pocket-reference-for-a-utility-every-unix-user-needs-pocket-
reference-o-reilly-1st-edition-bambenek/
Current Diagnosis and Treatment A Quick Reference for
the General Practitioner 3rd Edition James O.
Woolliscroft (Ed.)
https://ebookgate.com/product/current-diagnosis-and-treatment-a-
quick-reference-for-the-general-practitioner-3rd-edition-james-o-
woolliscroft-ed/
Red Hat Linux the complete reference 2. ed Edition
Petersen
https://ebookgate.com/product/red-hat-linux-the-complete-
reference-2-ed-edition-petersen/
A Dictionary of Plant Sciences Oxford Quick Reference
4th Edition Michael Allaby
https://ebookgate.com/product/a-dictionary-of-plant-sciences-
oxford-quick-reference-4th-edition-michael-allaby/
• Table of
Contents
LPI Linux Certification in a Nutshell
By Jeff Dean
Publisher : O'Reilly
Pub Date : May 2001
ISBN : 1-56592-748-6
Pages : 570
Slots : 1
Preface
The Linux Professional Institute
Audience for This Book
Organization
Conventions Used in This Book
How to Contact Us
Acknowledgments
Part I: General Linux Exam 101
Chapter 1. Exam 101 Overview
Chapter 2. Exam 101 Study Guide
Section 2.1. Exam Preparation
Chapter 3. GNU and Unix Commands (Topic 1.3)
Section 3.1. Objective 1: Work Effectively on the Unix Command Line
Section 3.2. Objective 2: Process Text Streams Using Text-Processing Filters
Section 3.3. Objective 3: Perform Basic File Management
Section 3.4. Objective 4: Use Unix Streams, Pipes,and Redirects
Section 3.5. Objective 5: Create, Monitor, and Kill Processes
Section 3.6. Objective 6: Modify Process Execution Priorities
Section 3.7. Objective 7: Making Use of Regular Expressions
Chapter 4. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4)
Section 4.1. Objective 1: Create Partitions and Filesystems
Section 4.2. Objective 2: Maintain the Integrity of Filesystems
Section 4.3. Objective 3: Control Filesystem Mounting and Unmounting
Section 4.4. Objective 4: Set and View Disk Quotas
Section 4.5. Objective 5: Use File Permissions to Control Access to Files
Section 4.6. Objective 6: Manage File Ownership
Section 4.7. Objective 7: Create and Change Hard and Symbolic Links
Section 4.8. Objective 8: Find System Files and Place Files in the Correct Location
Chapter 5. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6)
Section 5.1. Objective 1: Boot the System
Section 5.2. Objective 2: Change Runlevels and Shutdown or Reboot the System
Chapter 6. Documentation (Topic 1.8)
Section 6.1. Objective 1: Use and Manage Local System Documentation
Section 6.2. Objective 2: Find Linux Documentation on the Internet
Section 6.3. Objective 3: Write System Documentation
Section 6.4. Objective 4: Provide User Support
Chapter 7. Administrative Tasks (Topic 2.11)
Section 7.1. Objective 1: Manage Users and Group Accounts
Section 7.2. Objective 2: Tune the User Environment
Section 7.3. Objective 3: Configure and Use System Log Files
Section 7.4. Objective 4: Automate System Administration Tasks
Section 7.5. Objective 5: Maintain an Effective Data Backup Strategy
Chapter 8. Exam 101 Review Questions and Exercises
Section 8.1. GNU and Unix Commands (Topic 1.3)
Section 8.2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4)
Section 8.3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6)
Section 8.4. Documentation (Topic 1.8)
Section 8.5. Administrative Tasks (Topic 2.11)
Chapter 9. Exam 101 Practice Test
Section 9.1. Questions
Section 9.2. Answers
Chapter 10. Exam 101 Highlighter's Index
Section 10.1. GNU and Unix Commands (Topic 1.3)
Section 10.2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4)
Section 10.3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6)
Section 10.4. Documentation (Topic 1.8)
Section 10.5. Administrative Tasks (Topic 2.11)
Part II: General Linux Exam 102
Chapter 11. Exam 102 Overview
Chapter 12. Exam 102 Study Guide
Section 12.1. Exam Preparation
Chapter 13. Hardware and Architecture (Topic 1.1)
Section 13.1. Objective 1: Configure Fundamental System Hardware
Section 13.2. Objective 2: Set Up SCSI and NIC Devices
Section 13.3. Objective 3: Configure Modems and Sound Cards
Chapter 14. Linux Installation and Package Management (Topic 2.2)
Section 14.1. Objective 1: Design a Hard Disk Layout
Section 14.2. Objective 2: Install a Boot Manager
Section 14.3. Objective 3: Make and Install Programs from Source
Section 14.4. Objective 4: Manage Shared Libraries
Section 14.5. Objective 5: Use Debian Package Management
Section 14.6. Objective 6: Use Red Hat Package Manager (RPM)
Chapter 15. Kernel (Topic 1.5)
Section 15.1. Objective 1: Manage Kernel Modules at Runtime
Section 15.2. Objective 2: Reconfigure, Build, and Install a Custom Kernel and Modules
Chapter 16. Text-Editing, Processing, and Printing (Topic 1.7)
Section 16.1. Objective 1: Perform Basic File Editing Operations Using vi
Section 16.2. Objective 2: Manage Printers and Print Queues
Section 16.3. Objective 3: Print Files
Section 16.4. Objective 4: Install and Configure Local and Remote Printers
Chapter 17. Shells, Scripting, Programming, and Compiling (Topic 1.9)
Section 17.1. Objective 1: Customize and Use the Shell Environment
Section 17.2. Objective 2: Customize or Write Simple Scripts
Chapter 18. X (Topic 2.10)
Section 18.1. An Overview of X
Section 18.2. Objective 1: Install and Configure XFree86
Section 18.3. Objective 2: Set Up xdm
Section 18.4. Objective 3: Identify and Terminate Runaway X Applications
Section 18.5. Objective 4: Install and Customize a Window Manager Environment
Chapter 19. Networking Fundamentals (Topic 1.12)
Section 19.1. Objective 1: Fundamentals of TCP/IP
Section 19.2. Objective 3: TCP/IP Troubleshooting and Configuration
Section 19.3. Objective 4: Configure and Use PPP
Chapter 20. Networking Services (Topic 1.13)
Section 20.1. Objective 1: Configure and Manage inetd and Related Services
Section 20.2. Objective 2: Operate and Perform Basic Configuration of sendmail
Section 20.3. Objective 3: Operate and Perform Basic Configuration of Apache
Section 20.4. Objective 4: Properly Manage the NFS, SMB, and NMB Daemons
Section 20.5. Objective 5: Set Up and Configure Basic DNS Services
Chapter 21. Security (Topic 1.14)
Section 21.1. Objective 1: Perform Security Administration Tasks
Section 21.2. Objective 2: Set Up Host Security
Section 21.3. Objective 3: Set Up User-Level Security
Chapter 22. Exam 102 Review Questions and Exercises
Section 22.1. Hardware and Architecture ( Topic 1.1)
Section 22.2. Linux Installation and Package Management ( Topic 2.2)
Section 22.3. Kernel ( Topic 1.5)
Section 22.4. Text Editing, Processing, and Printing ( Topic 1.7)
Section 22.5. Shells, Scripting, Programming, and Compiling (Topic 1.9)
Section 22.6. X (Topic 2.10)
Section 22.7. Networking Fundamentals (Topic 1.12)
Section 22.8. Networking Services (Topic 1.13)
Section 22.9. Security (Topic 1.14)
Chapter 23. Exam 102 Practice Test
Section 23.1. Questions
Section 23.2. Answers
Chapter 24. Exam 102 Highlighter's Index
Section 24.1. Hardware and Architecture
Section 24.2. Linux Installation and Package Management
Section 24.3. Kernel
Section 24.4. Text-Editing, Processing, and Printing
Section 24.5. Shells, Scripting, Programming, and Compiling
Section 24.6. X
Section 24.7. Networking Fundamentals
Section 24.8. Networking Services
Section 24.9. Security
Glossary
Book: LPI Linux Certification in a Nutshell
Section: Preface
The Linux Professional Institute
The Linux Professional Institute, or LPI (http://www.lpi.org/), is a nonprofit organization formed
around the notion of certifying Linux administrators through a sort of open source process. The LPI
seeks input from the public for its exam Objectives and questions, and anyone is welcome to
participate. It has both paid and volunteer staff and receives funding from some major names in the
computer industry. The result is a vendor-neutral, publicly developed program that is offered at a
reasonable price.
The LPI organizes its Linux Professional Institute Certification (LPIC) series into three levels: LPIC
Levels 1, 2, and 3. Each level consists of two exams that are priced at $100 each. This book covers
the LPIC Level 1 exams, numbers 101 and 102.
LPI Level 1 Exams
The LPI offers its exams through Virtual University Enterprises (http://www.vue.com/). You may
establish an online account with VUE and resister for the exams using the company's web site. VUE
has more than two thousand testing centers worldwide, making the exams accessible in most areas.
The exams are presented in English using a PC-based automated examination program. Exam
questions are presented in multiple-choice single-answer, multiple-choice multiple-answer, and fill-in-
the-blank styles. However, a majority of the questions on the exams are multiple-choice single-
answer.
Level 1 is aimed at junior to midlevel Linux administrators, who should be comfortable with Linux at
the command line as well as capable of performing simple tasks, including system installation and
troubleshooting. While Exams 101 and 102 are not constructed to be difficult or misleading, together
they encompass a wide body of material, making preparation important for success even for
experienced administrators.
Each of the exams covers a series of Topics, which are numbered using a level.topic notation (i.e.,
1.2, 2.5, etc.). In the LPI's early stages of development, Topics were assigned to exams based on a
different scheme than we see today. When the scheme changed, the Topics were redistributed to
Exams 101 and 102, but the pairing of Topic numbers to exams was dropped. As a result, we have
1.x and 2.x Topics in both Level 1 Exams.
Each Topic contains a series of Objectives covering specific areas of expertise. The Level 1 Topics are
distributed between the two exams to create tests of similar length and difficulty without subject
matter overlap. As a result, there's no requirement for or advantage to taking them in sequence.
Exam 101 tests five Topics in approximately 60 questions, and Exam 102 tests nine Topics in
approximately 72 questions. Each exam is limited to 90 minutes.
Book: LPI Linux Certification in a Nutshell
Section: Preface
Audience for This Book
The primary audience for this book is, of course, candidates seeking the LPIC Level 1 certification.
These may range from administrators of other operating systems looking for a Linux certification to
complement an MCSE or other certification to Unix administrators wary of a growing pool of Linux-
certified job applicants. In any case, this book will help you with the specific information you require
to be successful with the Level 1 exams.
Due to the breadth of knowledge required by the LPI Objectives and the book's 1-to-1 coverage, it
also makes an excellent reference for skills and methods required for the day-to-day use of Linux. If
you have a basic working understanding of Linux administration, the material in this book will help
you fill in gaps in your knowledge while at the same time preparing you for the LPI exams, should you
choose to take them.
This book should also prove to be a valuable introduction for new Linux users and administrators
looking for a broad, detailed introduction to Linux. Part of the LPI exam-creation process includes a
survey of Linux professionals in the field. The survey results drive much of the content found on the
exams. Therefore, unlike general-purpose introductory Linux books, all of the information in this book
applies directly to running Linux in the real world.
Book: LPI Linux Certification in a Nutshell
Section: Preface
Organization
This book is designed to exactly follow the Topics and Objectives established by the LPI for Exams
101 and 102. That means that the presentation doesn't look like any other Linux book you've read.
Instead, you can directly track the LPI Objectives and easily measure your progress as you prepare.
The book is presented in two parts. Part I covers Exam 101 and Part II covers Exam 102. Each part
contains sections dedicated to the LPI Topics, and each of those sections contains information on all
of the Objectives set forth for the Topic. In addition, each part contains a practice exam (with
answers), review questions and exercises, and a handy "highlighter's index" that can help you review
important details.
There is also a glossary at the back of the book, which you can use to help familiarize yourself with
different Linux-related terms.
Parts 1 and 2: LPI Level 1 Exams 101 and 201
Part I and Part II each contain these sections:
Exam overview
Here you find an introduction to the exam along with details about the format of the questions.
Study guide
This section offers a few tips for preparing for the LPI Level 1 exams and introduces the
Objectives contained in the Topic sections that follow.
Topic sections
A separate section covers each of the Topic areas on the exam (five for Exam 101, nine for
Exam 102). These sections provide background information and in-depth coverage for each
Objective, with On the Exam tips dispersed throughout.
Review questions and exercises
This section reinforces important study areas with review questions. The purpose of this section
is to provide you with a series of exercises that can be used on a running Linux system to give
you valuable hands-on experience before you take the Level 1 exams.
Practice test
The practice test is designed to be similar in format and content to the actual LPI exams. You
should be able to attain at least an 80 percent score on the sample test before attempting the
live exam.
Highlighter's index
This unique section contains highlights and important facts culled from the Topic sections. You
can use this as review and reference material prior to taking the actual exams.
Each Objective set forth by the LPI is assigned a numeric weight, which acts as an indicator of the
importance of the Objective. Weights run between 1 and 10, with higher numbers indicating more
importance. An Objective carrying a weight of 1 can be considered relatively unimportant and isn't
likely to be covered in much depth on the exam. Objectives with larger weights are sure to be
covered on the exam, so you should study these Topics closely. The weights of the Objectives are
provided at the beginning of each Topic section.
Book: LPI Linux Certification in a Nutshell
Section: Preface
Conventions Used in This Book
This desktop quick reference follows certain typographical conventions:
Bold
Used for commands, programs, and options. All terms shown in bold are typed literally.
Italic
Used to show arguments and variables that should be replaced with user-supplied values. Italic
is also used to indicate filenames and directories and to highlight comments in examples.
Constant Width
Used to show the contents of files or the output from commands.
Constant Width Bold
Used in examples and tables to show commands or other text that should be typed literally by
the user.
Constant Width Italic
Used in examples and tables to show text that should be replaced with user-supplied values.
#, $
Used in some examples as the root shell prompt (#) and as the user prompt ($) under the
Bourne or bash shell.
On the Exam
These provide information about areas you should focus on when studying for the exam.
These signify a tip, suggestion, or general note.
These indicate a warning or caution.
A final word about syntax: in many cases, the space between an option and its argument can be
omitted. In other cases, the spacing (or lack of spacing) must be followed strictly. For example, -wn
(no intervening space) might be interpreted differently from -w n. It's important to notice the spacing
used in option syntax.
LPI Linux certification in a nutshell a desktop quick reference 1st ed Edition Jeffrey Dean
Book: LPI Linux Certification in a Nutshell
Section: Preface
How to Contact Us
We have tested and verified the information in this book to the best of our ability, but you may find
that features have changed (or even that we have made mistakes!). As a reader of this book and as
an LPI examinee, you can help us to improve future editions. Please let us know about any errors you
find, as well as your suggestions for future editions, by writing to:
O'Reilly & Associates, Inc.
101 Morris Street
Sebastopol, CA 95472
(800) 998-9938 (in the U.S. or Canada)
(707) 829-0515 (international/local)
(707) 829-0104 (fax)
You can also send us messages electronically. To be put on the mailing list or to request a catalog,
send email to:
info@oreilly.com
To ask technical questions or comment on the book, send email to:
bookquestions@ora.com
We have a web site for the book, where we'll list examples, errata, and any plans for future editions.
The site also includes a link to a forum where you can discuss the book with the author and other
readers. You can access this site at:
http://www.oreilly.com/catalog/lpicertnut
For more information about this book and others, see the O'Reilly web site:
http://www.oreilly.com/
If you have taken one or both of the LPIC Level 1 exams after preparing with this book and find that
parts of this book could better address your exam experience, we'd like to hear about it. Of course,
you are under obligation to the LPI not to disclose specific exam details, but comments regarding the
coverage of the LPI Objectives, level of detail, and relevance to the exam will be most helpful. We
take your comments seriously and will do whatever we can to make this book as useful as it can be.
Book: LPI Linux Certification in a Nutshell
Section: Preface
Acknowledgments
I'd like to thank the LPI, its staff, its contributors, and its sponsors for creating a unique and valuable
community-based certification program. The LPI mission and organization are in line with the open
source community it serves, and the LPIC series of certificates are respected and credible
achievements.
For their general good advice as well as some specific information on PC hardware, my thanks go to
Matt Welsh, Matthias Kalle Dalheimer, and Lar Kaufman, authors of Running Linux, Third Edition.
Likewise, Linux in a Nutshell, Third Edition, by Ellen Siever, Stephen Spainhour, Jessica P. Hekman,
and Stephen Figgins, is invaluable for reference information like bash programming details. I'm also
indebted to the many volunteer authors and editors contributing to the Linux Documentation Project.
A lot of important feedback came from technical reviewers Kara Prichard and Richard Fifarek, and my
hat's off to them for their detailed suggestions and corrections.
Of course, this book wouldn't be nearly as readable or as useful without the dedicated support of my
editor, Chuck Toporek. His guidance and encouragement kept me consistent, accurate, and
motivated, and the book wouldn't have been the same without him. Thanks, Chuck!
Thanks also to the others who helped with the completion of this book: Mary Brady, the production
editor; Claire Cloutier, the production manager; and Ellie Volckhausen, the cover designer.
Finally, I'd like to thank my lovely wife Monica, whose love, vision, and support made this project
possible in the first place, and my boys Austin and Alexander, my constant source of inspiration.
Book: LPI Linux Certification in a Nutshell
Preface
Objective certification of professionals is a time-honored tradition in many fields, including medicine
and law. As small computer systems and networks proliferated over the last decade, Novell and
Microsoft produced extremely popular certification products for their respective operating system and
network technologies. These two programs are often cited as having popularized a certification
market where products that had previously been highly specialized and relatively rare. These
programs have become so popular that a huge training and preparation industry has formed to
service a constant stream of new certification candidates.
Certification programs, offered by vendors such as Sun and Hewlett-Packard, have existed in the Unix
world for some time. However, since Solaris and HP-UX aren't commodity products, those programs
don't draw the crowds that the PC platform does. Linux, however, is different. Linux is both a
commodity operating system and is PC-based, and its popularity continues to grow at a rapid pace.
As Linux deployment increases, so too does the demand for qualified and certified Linux system
administrators.
A number of programs -- the Linux Professional Institute, Sair Linux and GNU Certification, the Red
Hat Certified Engineer (RHCE) program, and CompTIA's Linux+ -- have formed over the last few
years to service this new market. Each of these programs seeks to provide objective measurements
of a Linux administrator's skills, but they approach the problem in different ways.
The RHCE program requires that candidates pass a hands-on practical skills test, solving problems
and performing configuration tasks. Though more involved from an exam delivery point of view, this
type of test is very thorough and difficult to beat using purely good study habits. The Sair program is
provided by Sair, Inc., a for-profit company that is also a vendor for courseware and texts. The
Linux+ exam, scheduled for deployment in 2001, is an entry-level certification, which brings us to the
LPI.
Book: LPI Linux Certification in a Nutshell
Section: Part I: General Linux Exam 101
Chapter 1. Exam 101 Overview
LPI Exam 101 is one of two exams required for the LPIC Level 1 certification. In total, 14 major Topic
areas are specified for Level 1; this exam tests your knowledge on 5 of them.
Exam Topics are numbered using a level.topic notation (e.g., 1.2, 2.5). In the LPI's early stages of
development, Topics were assigned to exams based on a different scheme than we see today. When
the scheme changed, the Topics were redistributed to Exams 101 and 102, but the pairing of Topic
numbers to exams was dropped. As a result, we have 1.x and 2.x Topics in both Level 1 exams.
The Level 1 Topics are distributed between the two exams to create tests of similar length and
difficulty without subject matter overlap. As a result, there's no requirement for or advantage to
taking them in sequence.
Each Topic contains a series of Objectives covering specific areas of expertise. Each of these
Objectives is assigned a numeric weight, which acts as an indicator of the importance of the
Objective. Weights run between 1 and 10, with higher numbers indicating more importance. An
Objective carrying a weight of 1 can be considered relatively unimportant and isn't likely to be
covered in much depth on the exam. Objectives with larger weights are sure to be covered on the
exam, so you should study these Topics closely. The weights of the Objectives are provided at the
beginning of each Topic section.
The Topics for Exam 101 are listed in Table 1-1.
Table 1-1. LPI Topics for Exam 101
Name
Number of
Objectives
Description
Chapter
3
7
This Topic covers many GNU and Unix commands used during day-to-day
system administration activity. Objectives include command syntax, text
filters, file management, pipes, redirects, process management, process
execution priorities, and basic regular expressions.
Chapter
4
8
Objectives for this Topic include the creation of partitions and filesystems,
filesystem integrity, mounting, quotas, permissions, ownership, links, and
file location tasks.
Chapter
5
2
This short Topic covers system boot, lilo, syslog, runlevels, shutdown,
and reboot.
Chapter
6
4
This is an overview of Linux documentation sources, such as manpages, info
pages, /usr/doc, Linux-related web sites, and the generation of local
documentation. It also includes some discussion of user support.
Chapter
7
5
This core system administration Topic includes user and group accounts,
user environment issues, syslog, cron, at, and backup.
As you can see from Table 1-1 the Topic numbers assigned by the LPI are not sequential. This is due
to various modifications made by the LPI to its exam program as it developed. The Topic numbers
serve only as reference and are not used on the exam.
Exam 101 lasts a maximum of 90 minutes and contains approximately 60 questions. The exam is
administered using a custom application on a PC in a private room with no notes or other reference
material. About 75 percent of the exam is made up of multiple-choice single-answer questions. These
questions have only one correct answer and are answered using radio buttons. Some of them present
a scenario needing administrative action. Others seek appropriate commands for a particular task or
for proof of understanding of a particular concept.
About 10 percent of the exam questions are multiple-choice multiple-answer questions, which are
answered using checkboxes. These questions can have multiple correct responses, each of which
must be checked. This is probably the most difficult question style because the multiple answers
increase the likelihood of mistakes. But they also are a good test of your knowledge of Unix
commands, since an incorrect response on any one of the possible answers causes you to miss the
entire question. The exam also has some fill-in-the-blank questions. These questions provide a one-
line text area input box for you to fill in your answer. These questions check your knowledge of
concepts such as important files and commands, plus common facts that you are expected to be
aware of.
Book: LPI Linux Certification in a Nutshell
Part I: General Linux Exam 101
Part I covers the Topics and Objectives for the LPI's General Linux Certification for Exam 101
and includes the following sections:
Exam 101 Overview
Exam 101 Study Guide
GNU and Unix Commands
Devices, Linux Filesystems, and the Filesystem Hierarchy Standard
Boot, Initialization, Shutdown, and Runlevels
Documentation
Administrative Tasks
Exam 101 Review Questions and Exercises
Exam 101 Practice Test
Exam 101 Highlighter's Index
Book: LPI Linux Certification in a Nutshell
Section: Part I: General Linux Exam 101
Chapter 2. Exam 101 Study Guide
Part I of this book contains a section for each of the five Topics found on LPI Exam 101. Each section
details certain Objectives, which are described here and on the LPI web site, http://www.lpi.org/p-
obj-101.html.
Book: LPI Linux Certification in a Nutshell
Section: Chapter 2. Exam 101 Study Guide
2.1 Exam Preparation
LPI Exam 101 is thorough, but you should find it fairly straightforward if you have a solid foundation
in Linux concepts. You won't come across questions that intend to trick you, and you're unlikely to
find ambiguous questions.
Exam 101 mainly tests your knowledge of facts, including commands and their common options,
important file locations, configuration syntax, and common procedures. Your recollection of these
details, regardless of your level of Linux administration experience, will directly influence your results.
For clarity, the material in the following sections is presented in the same order as the LPI Topics and
Objectives. However, you may choose to study the Topics in any order you wish. To assist you with
your preparation, Table 2-1 through Table 2-5 list the Topics and Objectives found on Exam 101.
Objectives within each Topic occupy rows of the corresponding table, including the Objective's
number, description, and weight. The LPI assigns a weight for each Objective to indicate the relative
importance of that Objective on the exam on a scale of 1 to 10. We recommend that you use the
weights to prioritize what you decide to study in preparation for the exams. After you complete your
study of each Objective, simply check it off here to measure and organize your progress.
Table 2-1. GNU and Unix Commands (Topic 1.3)
Objective Weight Description
1 4 Section 3.1
2 7 Section 3.2
3 2 Section 3.3
4 3 Section 3.4
5 5 Section 3.5
6 2 Section 3.6
7 3 Section 3.7
Table 2-2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4)
Objective Weight Description
1 3 Section 4.1
2 5 Section 4.2
3 3 Section 4.3
4 1 Section 4.4
5 3 Section 4.5
6 2 Section 4.6
7 2 Section 4.7
8 2 Section 4.8
Table 2-3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6)
Objective Weight Description
1 3 Section 5.1
2 3 Section 5.2
Table 2-4. Documentation (Topic 1.8)
Objective Weight Description
1 5 Section 6.1
2 2 Section 6.2
3 1 Section 6.3
4 1 Section 6.4
Table 2-5. Administrative Tasks (Topic 2.11)
Objective Weight Description
1 7 Section 7.1
2 4 Section 7.2
3 3 Section 7.3
4 4 Section 7.4
5 3 Section 7.5
Book: LPI Linux Certification in a Nutshell
Section: Part I: General Linux Exam 101
Chapter 3. GNU and Unix Commands (Topic 1.3)
This Topic covers the ever-important aspect of working interactively with Linux command-line utilities.
While it's true that GUI tools are already available to manage just about everything on a Linux
system, a firm understanding of basic use of command-line utilities is essential.
The family of commands that are part of Linux and Unix systems has a long history. Individuals or
groups that needed specific tools contributed many of the commands in the early days of Unix
development. Those that were popular became part of the system and were accepted as default tools
under the Unix umbrella. Today, Linux systems carry new, often more powerful GNU versions of these
historical commands.
This section covers LPI Topic 1.3, GNU and Unix Commands. Even the Topic name implies the
confusion that may exist regarding the origin of the commands we're using on GNU/Linux systems.
Remember that for software to be freely distributed as part of your Linux distribution, it cannot be
proprietary and must come with some form of redistribution ability in its licensing terms.
This LPI Topic has seven Objectives:
Objective 1: Work Effectively on the Unix Command Line
This Objective covers the essentials of working at the command line in a shell, including
environment variables, using the command history and editing facilities, invoking commands,
command substitution, and recursively executing commands. Weight: 4.
Objective 2: Process Text Streams Using Text-Processing Filters
There exists a diverse "toolbox" of interesting and powerful utilities from the GNU textutils
package, which can be used to manipulate text in various ways. This Objective covers those
utilities and how to use them. Weight: 7.
Objective 3: Perform Basic File Management
If you're used to an entirely GUI computing environment, performing basic file management
manually from the command line may be awkward at first. You'll find, however, that after
mastering a few simple commands you will achieve much finer control over file management
chores. This Objective covers simple and recursive file management, including the use of
wildcards (regular expressions). Weight: 2.
Objective 4: Use Unix Streams, Pipes, and Redirects
Among the most powerful concepts in the Linux and Unix worlds is the idea of creating text
streams. This powerful tool offers you the ability to succinctly string various commands (such
as those described in Objective 2) together into customized editing chains, which modify text in
a serial fashion. Objective 4 includes redirection and the use of the tee command. Weight: 3.
Objective 5: Create, Monitor, and Kill Processes
Every running program on a Linux system is a process. Some processes are short-lived, like
utility programs such as ls. Other processes, usually called daemons, are intended to run for
extended periods or even constantly; these include processes such as web or database server
software. Managing these processes is an important activity for a system administrator. This
Objective covers foreground and background processing, process monitoring, signaling, and
how to "kill" a process. Also covered are some of the commands used to manipulate running
processes. Weight: 5.
Objective 6: Modify Process Execution Priorities
When you launch a process, you may wish to instruct the system to lower or raise its
scheduling priority relative to the default. This action has the effect of giving more or less CPU
time to your process. This is accomplished with the nice command, which modifies the default
scheduling priority prior to running your command. This Objective covers these modifications.
Weight: 2.
Objective 7: Perform Searches of Text Files Making Use of Regular Expressions
Many tools on your Linux system are capable of using regular expressions. At the most basic
level, regular expressions are simply wildcard-matching mechanisms, such as you've probably
used at the command line many times. While detailed use is beyond the scope of this book and
the LPI exams, regular expressions are a powerful solution to a range of problems. This
Objective covers basic regular expression usage with command-line tools such as sed and
grep. Weight: 3.
The tools and concepts discussed here represent important and fundamental aspects of working with
Linux, and are essential for your success on Exam 101.
Book: LPI Linux Certification in a Nutshell
Section: Chapter 3. GNU and Unix Commands (Topic 1.3)
3.1 Objective 1: Work Effectively on the Unix Command Line
Every computer system requires a human interface component. For Linux system administration, a
text interface is typically used. The system presents the administrator with a prompt, which at its
simplest is a single character such as $ or #. The prompt signifies that the system is ready to accept
typed commands, which usually occupy one or more lines of text. This interface is generically called
the command line.
It is the job of a program called a shell to provide the command prompt and to interpret commands.
The shell provides an interface layer between the Linux kernel and the human user, which is how it
gets its name. The original shell for Unix systems was written by Steve Bourne and was called simply
sh. The default Linux shell is bash, the Bourne-Again Shell, which is a GNU variant of sh. The
popular tcsh shell, a variant of the original csh (or C shell), is also provided. The bash shell is the
subject of an entire LPI Topic, covered in Chapter 17. At this point, we are primarily concerned with
our interaction with bash and the effective use of commands.
3.1.1 The Interactive Shell
The shell is a powerful programming environment, capable of automating nearly anything you can
imagine on your Linux system. The shell is also your interactive interface to your system. When you
first start a shell, it does some automated housekeeping to get ready for your use, and then presents
a command prompt. The command prompt tells you that the shell is ready to accept commands from
its standard input device, which is usually the keyboard. Shells can run standalone, as on a physical
terminal, or within a window in a GUI environment. Whichever the case, their use is the same.
3.1.1.1 Shell variable basics
During execution, bash maintains a set of shell variables that contain information important to the
execution of bash. Most of these variables are set when bash starts, but they can be set manually at
any time.
The first shell variable of interest in this Topic is called PS1 (which simply stands for Prompt String 1).
This special variable holds the contents of the command prompt that are displayed when bash is
ready to accept commands (there is also a PS2 variable, used when bash needs multiple-line input to
complete a command). You can easily display the contents of PS1, or any other shell variable, by
using the echo command with the variable name preceded by the $ symbol:
$ echo $PS1
$
The $ output tells us that PS1 contains the two characters  and $. The backslash character tells
the shell not to interpret the dollar symbol in any special way (that is, as a metacharacter, described
later in this section). A simple dollar sign such as this was the default prompt for sh, but bash offers
options to make the prompt much more informative. On your system, the default prompt stored in
PS1 is probably something like:
[u@h W]$
Each of the characters preceded by backslashes have a special meaning to bash, while those without
backslashes are interpreted literally. In this example, u is replaced by the username, h is replaced
by the system's hostname, W is replaced by the "bottom" portion of the current working directory,
and $ is replaced by a $ character.[1] This yields a prompt of the form:
[1] Unless you are root, in which case $ is replaced by #.
[jdean@linuxpc jdean]$
How your prompt is formulated is really just a convenience and does not affect how the shell
interprets your commands. However, adding information to the prompt, particularly regarding
system, user, and directory location, can make life easier when hopping from system to system and
logging in as multiple users (as yourself and root, for example). See the documentation on bash for
more information on customizing prompts.
Another shell variable that is extremely important during interactive use is PATH , which contains a
list of all the directories that hold commands or other programs you are likely to execute. A default
path is set up for you when bash starts. You may wish to modify the default to add other directories
that hold programs you need to run.
Every file in the Linux filesystem can be specified in terms of its location. The
less program, for example, is located in the directory /usr/bin. Placing /usr/bin
in your PATH enables you to execute less by simply typing less rather than
the explicit /usr/bin/less.
In order for bash to find and execute the command you enter at the prompt, the command must be
either:
A bash built-in command that is part of bash itself
An executable program located in a directory listed in the PATH variable
Explicitly defined
The shell holds PATH and other variables for its own use. However, many of the shell's variables are
needed during the execution of programs launched from the shell (including other shells). For these
variables to be available, they must be exported, at which time they become environment variables.
Environment variables are passed on to programs and other shells, and together they are said to
form the environment in which the programs execute. PATH is always made into an environment
variable.[2] Exporting a shell variable to turn it into an environment variable is done using the export
command:
[2] In the case of csh and tcsh, there are both shell and environment variables for PATH; the
shell takes care of keeping them synchronized.
$ export MYVAR
When a variable is exported to the environment, it is passed into the environment of all child
processes. That is, it will be available to all programs run by your shell.
3.1.1.2 Entering commands at the command prompt
Commands issued to the shell on a Linux system generally consist of four components:
A valid command (a shell built-in, a program or script found among directories listed in the
PATH, or an explicitly defined program)
Command options, usually preceded by a dash
Arguments
Line acceptance (i.e., pressing the Enter key), which we assume in the examples
Each command has its own unique syntax, though most follow a fairly standard form. At minimum, a
command is necessary:
$ ls
This simple command lists files in the current working directory. It requires neither options nor
arguments. Generally, options are letters or words preceded by a single or double dash and are
added after the command and separated from it by a space:
$ ls -l
The -l option modifies the behavior of the ls program by listing files in a longer, more detailed
format. In most cases, single-dash options can be either combined or specified separately. To
illustrate this, consider these two equivalent commands:
$ ls -l -a
$ ls -la
By adding the -a option, ls does not hide files beginning with a dot (which it does by default). Adding
that option by specifying -la yields the same result. Some commands offer alternative forms for the
same option. In the preceding example, the -a option can be replaced with -- all:
$ ls -l --all
These double-dash full-word options are frequently found in programs from the GNU project. They
cannot be combined as the single-dash options can. Both types of options can be freely intermixed.
Although the longer GNU-style options require more typing, they are easier to remember and easier
to read in scripts than the single-letter options.
Adding an argument further refines the command's behavior:
$ ls -l *.c
Now the command will give a detailed listing only of C program source files (those with the .c
extension), if they exist, in the current working directory. In this example, if no .c files exist, no
output will be given.[3] Sometimes, options and arguments can be mixed in order:
[3] If a Unix or GNU command has nothing of significance to tell you, it most likely will remain
silent. This brevity may take some users by surprise, particularly if they are used to systems
that yield messages indicating something like "successful completion, but sorry, no results."
$ ls --all *.c -l
In this case, ls was able to determine that -l is an option and not another file descriptor.
Some commands, such as tar and ps, don't require the dash preceding an option because at least
one option is expected or required. Also, an option often instructs the command that the subsequent
item on the command line is a specific argument. For example:
$ tar cf mytarfile file1 file2 file3
$ tar -cf mytarfile file1 file2 file3
These equivalent commands use tar to create an archive file named mytarfile and put three files (
file1, file2, and file3) into it. In this case, the f option tells tar that archive filename mytarfile follows
immediately after the option.
Just as any natural language contains exceptions and variations, so does the syntax used for GNU
and Unix commands. You should have no trouble learning the essential syntax for the commands you
need to use often. The capabilities of the command set offered on Linux are extensive, making it
highly unlikely that you'll memorize all of the command syntax you need. Most systems
administrators are constantly learning about features they've never used in commands they use
regularly. It is standard practice to regularly refer to man or info pages and other documentation on
commands you're using, so feel free to explore and learn as you go.
3.1.1.3 Entering commands not in the PATH
Occasionally, you will need to execute a command that is not in your path and not built into your
shell. If this need arises often, it may be best to simply add the directory that contains the command
to your path. However, there's nothing wrong with explicitly specifying a command's location and
name completely. For example, the ls command is located in /bin. This directory is most certainly in
your PATH variable (if not, it should be!), which allows you to enter the ls command by itself on the
command line:
$ ls
The shell will look for an executable file named ls in each successive directory listed in your PATH
variable and will execute the first one it finds. Specifying the fully qualified filename for the command
eliminates the directory search and yields identical results:
$ /bin/ls
Any executable file on your system may be started in this way. However, it is important to remember
that some programs may have requirements during execution about what is listed in your PATH. A
program can be launched normally but may fail if it is unable to find a required resource if the PATH is
incomplete.
3.1.1.4 Entering multiple-line commands interactively
In addition to its interactive capabilities, the shell also has a complete programming language of its
own. Many programming features can be very handy at the interactive command line as well. Looping
constructs, including for, until, and while are often used this way. When you begin a command such
as these, which normally spans multiple lines, bash prompts you for the subsequent lines until a valid
command has been completed. The prompt you receive in this case is stored in shell variable PS2,
which by default is >. For example, if you wanted to repetitively execute a series of commands each
time with a different argument from a known series, you could enter the following:
$ ...series of commands on arg1...
command output
$ ...series of commands on arg2...
command output
$ ...series of commands on arg2...
command output
Rather than entering each command manually, you can interactively use bash's for loop construct to
do the work for you. Note that indented style, such as what you might use in traditional
programming, isn't necessary when working interactively with the shell:
$ for var in arg1 arg2 arg3
> do
> echo $var
> ...series of commands...
> done
arg1
command output
arg2
command output
arg3
command output
Mixing the command-line world with the shell-scripting world in this way can make certain tasks
surprisingly efficient.
3.1.1.5 Entering command sequences
There may be times when it is convenient to place multiple commands on a single line. Normally,
bash assumes you have reached the end of a command (or the end of the first line of a multiple-line
command) when you press Return. To add more than one command to a single line, the commands
can be separated and entered sequentially with the command separator , a semicolon. Using this
syntax, the following commands:
$ ls
$ ps
are, in essence, identical to and will yield the same result as the following single-line command that
employs the command separator:
$ ls; ps
On the Exam
Command syntax and the use of the command line is very important. Pay special attention
to the use of options and arguments and how they are differentiated. Also be aware that
some commands expect options to be preceded by a dash while other commands do not.
3.1.2 Command History and Editing
If you consider interaction with the shell as a kind of conversation, it's a natural extension to refer
back to things "mentioned" previously. You may type a long and complex command that you want to
repeat, or perhaps you need to execute a command multiple times with slight variation.
If you work interactively with the original Bourne shell, maintaining such a "conversation" can be a bit
difficult. Each repetitive command must be entered explicitly, each mistake must be retyped, and if
your commands scroll off the top of your screen, you have to recall them from memory. Modern shells
such as bash and tcsh include a significant feature set called command history, expansion, and
editing. Using these capabilities, referring back to previous commands is painless, and your
interactive shell session becomes much simpler and more effective.
The first part of this feature set is command history. When bash is run interactively, it provides
access to a list of commands previously typed. The commands are stored in the history list prior to
any interpretation by the shell. That is, they are stored before wildcards are expanded or command
substitutions are made. The history list is controlled by the HISTSIZE shell variable. By default,
HISTSIZE is set to 500 lines, but you can control that number by simply adjusting HISTSIZE's value.
In addition to commands entered in your current bash session, commands from previous bash
sessions are stored by default in a file called ~/.bash_history (or the file named in shell variable
HISTFILE).[4] To view your command history, use the bash built-in history command. A line number
will precede each command. This line number may be used in subsequent history expansion. History
expansion uses either a line number from the history or a portion of a previous command to
reexecute that command.[5] Table 3-1 lists the basic history expansion designators. In each case,
using the designator as a command causes a command from the history to be executed again.
[4] If you use multiple shells in a windowed environment (as just about everyone does), the last
shell to exit will write its history to ~/.bash_history. For this reason you may wish to use one
shell invocation for most of your work.
[5] History expansion also allows a fair degree of command editing using syntax you'll find in the
bash documentation.
Table 3-1. Command History Expansion Designators
Designator Description
!!
Often called bang-bang,[6] this command refers to the most recent
command.
!n
Refer to command n from the history. You'll use the history command to
display these numbers.
!-n Refer to the current command minus n from the history.
! string Refer to the most recent command starting with string.
!? string Refer to the most recent command containing string.
^ string1^string2
Quick substitution. Repeat the last command, replacing the first occurrence of
string1 with string2.
[6] The exclamation point is often called bang on Linux and Unix systems.
While using history substitution can be useful for executing repetitive commands, command history
editing is much more interactive. To envision the concept of command history editing, think of your
entire bash history (including that obtained from your ~/.bash_history file) as the contents of an
editor's buffer. In this scenario, the current command prompt is the last line in an editing buffer, and
all of the previous commands in your history lie above it. All of the typical editing features are
available with command history editing, including movement within the "buffer," searching, cutting,
pasting, and so on. Once you're used to using the command history in an editing style, everything
you've done on the command line becomes available as retrievable, reusable text for subsequent
commands. The more familiar you become with this concept, the more useful it can be.
By default, bash uses key bindings like those found in the Emacs editor for command history
editing.[7] If you're familiar with Emacs, moving around in the command history will be familiar and
very similar to working in an Emacs buffer. For example, the key command Ctrl-p (depicted as C-p)
will move up one line in your command history, displaying your previous command and placing the
cursor at the end of it. This same function is also bound to the up arrow key. The opposite function is
bound to C-n (and the down arrow). Together, these two key bindings allow you to examine your
history line by line. You may reexecute any of the commands shown simply by pressing Return when
it is displayed. For the purposes of Exam 101, you'll need to be familiar with this editing capability,
but detailed knowledge is not required. Table 3-2 lists some of the common Emacs key bindings you
may find useful in bash. Note that C- indicates the Ctrl key, while M- indicates the Meta key, which is
usually Alt on PC keyboards.[8]
[7] An editing style similar to the vi editor is also available.
[8] In unusual circumstances, such as on a terminal, using the meta key means pressing the
Escape (Esc) key, releasing it, and then pressing the defined key. The Esc key is not a
modifier, but serves to modify meta keys when an Alt-style key is unavailable.
Table 3-2. Basic Command History Editing Emacs Key Bindings
Key Description
C-p Previous line (also up arrow)
C-n Next line (also down arrow)
C-b Back one character (also left arrow)
C-f Forward one character (also right arrow)
C-a Beginning of line
C-e End of line
C-l Clear the screen, leaving the current line at the top of the screen
M-< Top of history
M-> Bottom of history
C-d Delete character from right
C-k Delete (kill) text from cursor to end of line
C-y Paste (yank) text previously cut (killed)
M-d Delete (kill) word
C-rtext Reverse search for text
C-stext Forward search for text
3.1.2.1 Command substitution
bash offers a handy ability to do command substitution. This feature allows you to replace the result
of a command with a script. For example, wherever $( command) is found, its output will be
substituted. This output could be assigned to a variable, as in the number of lines in the .bashrc file:
$ RCSIZE=$(wc -l ~/.bashrc)
Another form of command substitution is `command`. The result is the same, except that the
backquote syntax has some special rules regarding metacharacters that the $(command) syntax
avoids.
3.1.2.2 Applying commands recursively through a directory tree
There are many times when it is necessary to execute commands recursively. That is, you may need
to repeat a command throughout all the branches of a directory tree. Recursive execution is very
useful but also can be dangerous. It gives a single interactive command the power to operate over a
much broader range of your system than your current directory, and the appropriate caution is
necessary. Think twice before using these capabilities, particularly when operating as the superuser.
Some of the GNU commands on Linux systems have built-in recursive capabilities as an option. For
example, chmod modifies permissions on files in the current directory:
$ chmod g+w *.c
In this example, all files with the .c extension in the current directory are modified with the group-
write permission. However, there may be a number of directories and files in hierarchies that require
this change. chmod contains the -R option (note the uppercase option letter; you may also use --
recursive), which instructs the command to operate not only on files and directories specified on the
command line, but also on all files and directories contained under the specified directories. For
example, this command gives the group-write permission to all files in a source-code tree named src:
$ chmod -R g+w src
Provided you have the correct privileges, this command will descend into each subdirectory in the src
directory and add the requested permission to each file and directory it finds. Other example
commands with this ability include cp (copy), ls (list files), and rm (remove files).
A more general approach to recursive execution through a directory is available by using the find
command. This is an extremely powerful command because it can tell you a lot about your system's
file structure. find is inherently recursive and is intended to descend through directories looking for
files with certain attributes or executing commands. At its simplest, find displays an entire directory
hierarchy when you simply enter the command with a target directory:
$ find src
...files and directories are listed recursively...
To get more specific, add the -name option to search the same directories for C files:
$ find src -name "*.c"
....c files are listed recursively[9]...
[9] This can be done recursively with the ls command as well.
find can also execute commands against its results with the -exec option, which can execute any
command against each successive element listed by find. During execution, a special variable {} is
replaced by these find results. The command entered after the -exec option must be terminated by
a semicolon; any metacharacters used -- including the semicolon -- must be either quoted or
escaped. To take the previous example a little further, rather than execute the chmod recursively
against all files in the src directory, find can execute it against the C files only, like this:
$ find src -name "*.c" -exec chmod g+w {} ;
The find command is capable of much more than this simple example and can locate files with
particular attributes such as dates, protections, file types, access times, and others. While the syntax
can be confusing, the results are worth some study of find.
Book: LPI Linux Certification in a Nutshell
Section: Chapter 3. GNU and Unix Commands (Topic 1.3)
3.2 Objective 2: Process Text Streams Using Text-Processing Filters
Many of the commands on Linux systems are intended to be used as filters, which modify text in
helpful ways. Text fed into the command's standard input or read from files is modified in some useful
way and sent to standard output or to a new file. Multiple commands can be combined to produce
text streams, which are modified at each step in a pipeline formation. This section describes basic use
and syntax for the filtering commands important for Exam 101. Refer to a Linux command reference
for full details on each command and the many other available commands.
cut
Syntax
cut options [files]
Description
Cut out (that is, print) selected columns or fields from one or more files. The source file is not
changed. This is useful if you need quick access to a vertical slice of a file. By default, the slices are
delimited by a tab.
Frequently used options
-b list
Print bytes in list positions.
-c list
Print characters in list columns.
-d delim
Set field delimiter for -f.
-f list
Print list fields.
Examples
Show usernames (in the first colon-delimited field) from /etc/passwd:
$ cut -d: -f1 /etc/passwd
Show first column of /etc/passwd:
$ cut -c 1 /etc/passwd
expand
Syntax
expand [options] files
Description
Convert tabs to spaces. Sometimes the use of tab characters can make output that is attractive on
one output device look bad on another. This command eliminates tabs and replaces them with the
equivalent number of spaces. By default, tabs are assumed to be eight spaces apart.
Frequently used options
-t tabs
Specify tab stops, in place of default 8.
-i
Initial; convert only at start of lines.
fmt
Syntax
fmt [options] [files]
Description
Format text to a specified width by filling lines and removing newline characters. Multiple files from
the command line are concatenated.
Frequently used options
-u
Use uniform spacing: one space between words and two spaces between sentences.
-w width
Set line width to width. The default is 75 characters.
head
Syntax
head [options] [files]
Description
Print the first few lines of one or more files (the "head" of the file or files). When more than one file is
specified, a header is printed at the beginning of each file, and each is listed in succession.
Frequently used options
-c n
Print the first n bytes, or if n is followed by k or m, print the first n kilobytes or megabytes,
respectively.
-l n
Print the first n lines. The default is 10.
join
Syntax
join [options] file1 file2
Description
Print a line for each pair of input lines, one each from file1 and file2, that have identical join fields.
This function could be thought of as a very simple database table join, where the two files share a
common index just as two tables in a database would.
Frequently used options
-j1 field
Join on field of file1.
-j2 field
Join on field of file2.
-j field
Join on field of both file1 and file2.
Example
Suppose file1 contains the following:
1 one
2 two
3 three
and file2 contains:
1 11
2 22
3 33
Issuing the command:
$ join -j 1 file1 file2
yields the following output:
1 one 11
2 two 22
3 three 33
nl
Syntax
nl [options] [files]
Description
Number the lines of files, which are concatenated in the output. This command is used for numbering
lines in the body of text, including special header and footer options normally excluded from the line
numbering. The numbering is done for each logical page, which is defined as having a header, a
body, and a footer. These are delimited by the special strings :::, ::, and :, respectively.
Frequently used options
-b style
Set body numbering style to style, t by default.
-f style
Set footer number style to style, n by default.
-h style
Set header numbering style to style, n by default.
Styles can be in these forms:
A
Number all lines.
t
Only number non-empty lines.
n
Do not number lines.
pREGEXP
Only number lines that contain a match for regular expression REGEXP.
Example
Suppose file file1 contains the following text:
:::
header
::
line1
line2
line3
:
footer
:::
header
::
line1
line2
line3
:
footer
If the following command is given:
$ nl -h a file1
the output would yield numbered headers and body lines but no numbering on footer lines. Each new
header represents the beginning of a new logical page and thus a restart of the numbering sequence:
1 header
2 line1
3 line2
4 line3
footer
1 header
2 line1
3 line2
4 line3
footer
od
Syntax
od [options] [files]
Description
Dump files in octal and other formats. This program prints a listing of a file's contents in a variety of
formats. It is often used to examine the byte codes of binary files but can be used on any file or input
stream. Each line of output consists of an octal byte offset from the start of the file followed by a
series of tokens indicating the contents of the file. Depending on the options specified, these tokens
can be ASCII, decimal, hexadecimal, or octal representations of the contents.
Frequently used options
-t type
Specify the type of output. Typical types include:
A
Named character
c
ASCII character or backslash escape
O
Octal (the default)
x
Hexadecimal
Example
If file1 contains:
a1n
A1n
where n stands for the newline character. The od command specifying named characters yields the
following output:
$ od -t a file1
00000000 a 1 nl A 1 nl
00000006
A slight nuance is the ASCII character mode. This od command specifying named characters yields
the following output with backslash-escaped characters rather than named characters:
$ od -t c file1
00000000 a 1 n A 1 n
00000006
With numeric output formats, you can instruct od on how many bytes to use in interpreting each
number in the data. To do this, follow the type specification by a decimal integer. This od command
specifying single-byte hex results yields the following output:
$ od -t x1 file1
00000000 61 31 0a 41 31 0a
00000006
Doing the same thing in octal notation yields:
$ od -t o1 file1
00000000 141 061 012 101 061 012
00000006
If you examine an ASCII chart with hex and octal representations, you'll see that these results match
those tables.
paste
Syntax
paste [options] files
Description
Paste together corresponding lines of one or more files into vertical columns.
Frequently used options
-d'n'
Separate columns with character n in place of the default tab.
-s
Merge lines from one file into a single line. When multiple files are specified, their contents are
placed on individual lines of output, one per file.
For the following three examples, file1 contains:
1
2
3
and file2 contains:
A
B
C
Example 1
A simple paste creates columns from each file in standard output:
$ paste file1 file2
1 A
2 B
3 C
Example 2
The column separator option yields columns separated by the specified character:
$ paste -d'@' file1 file2
1@A
2@B
3@C
Example 3
The single-line option (-s) yields a line for each file:
$ paste -s file1 file2
1 2 3
A B C
pr
Syntax
pr [options] [file]
Description
Convert a text file into a paginated, columnar version, with headers and page fills. This command is
convenient for yielding nice output, such as for a line printer from raw uninteresting text files. The
header will consist of the date and time, the filename, and a page number.
Frequently used options
-d
Double space.
-h header
Use header in place of the filename in the header.
-l lines
Set page length to lines. The default is 66.
-o width
Set the left margin to width.
split
Syntax
split [option] [infile] [outfile]
Description
Split infile into a specified number of line groups, with output going into a succession of files,
outfileaa, outfileab, and so on (the default is xaa, xab, etc.). The infile remains unchanged. This
command is handy if you have a very long text file that needs to be reduced to a succession of
smaller files. This was often done to email large files in smaller chunks, because it was at one time
considered bad practice to send single large email messages.
Frequently used option
-n
Split the infile into n-line segments. The default is 1000.
Example
Suppose file1 contains:
1 one
2 two
3 three
4 four
5 five
6 six
Then the command:
$ split -2 file1 splitout_
yields as output three new files, splitout_aa, splitout_ab, and splitout_ac. The file splitout_aa
contains:
1 one
2 two
splitout_ab contains:
3 three
4 four
and splitout_ac contains:
5 five
6 six
tac
Syntax
tac [file]
Description
This command is named as an opposite for the cat command, which simply prints text files to
standard output. In this case, tac prints the text files to standard output with lines in reverse order.
Example
Suppose file1 contains:
1 one
2 two
3 three
Then the command:
$ tac file1
yields as output:
3 three
2 two
1 one
tail
Syntax
tail [options] [files]
Description
Print the last few lines of one or more files (the "tail" of the file or files). When more than one file is
specified, a header is printed at the beginning of each file, and each is listed in succession.
Frequently used options
-c n
This option prints the last n bytes, or if n is followed by k or m, the last n kilobytes or
megabytes, respectively.
-f
Follow the output dynamically as new lines are added to the bottom of a file.
-n m
Prints the last m lines. The default is 10.
-f
Continuously display a file as it is actively written by another process. This is useful for
watching log files as the system runs.
tr
Syntax
tr [options] [[string1 [string2]]
Description
Translate characters from string1 to the corresponding characters in string2. tr does not have file
arguments and therefore must use standard input and output. If string1 and string2 specify ranges
(a-z or A-Z), they should represent the same number of characters.
Frequently used options
-d
Delete characters in string1 from the output.
-s
Squeeze out repeated output characters in string1.
Example 1
To change all lowercase characters in file1 to uppercase, use either of these commands:
$ cat file1 | tr a-z A-Z
or:
$ tr a-z A-Z < file1
Example 2
To suppress repeated "a" characters from file1:
$ cat file1 | tr -s a
Example 3
To remove all "a," "b," and "c" characters from file1:
$ cat file1 | tr -d abc
wc
Syntax
wc [options] [files]
Description
Print counts of characters, words, and lines for files. When multiple files are listed, statistics for each
file output on a separate line with a cumulative total output last.
Frequently used options
-c
Print the character count only.
-l
Print the line count only.
-w
Print the word count only.
Example 1
Show all counts and totals for file1, file2, and file3:
$ wc file[123]
Example 2
Count the number of lines in file1:
$ wc -l file1
xargs
Syntax
xargs [options] [command] [initial-arguments]
Description
Execute command followed by its optional initial-arguments and append additional arguments found
on standard input. Typically, the additional arguments are filenames in quantities too large for a
single command line. xargs runs command multiple times to exhaust all arguments on standard
input.
Frequently used options
-n maxargs
Limit the number of additional arguments to maxargs for each invocation of command.
-p
Interactive mode. Prompt the user for each execution of command.
Example
Use grep to search a long list of files, one by one, for the word "linux":
$ find / -type f | xargs -n 1 grep linux
find searches for normal files (-type f ) starting at the root directory. xargs executes grep once for
each of them due to the -n 1 option.
3.2.1 The Stream Editor, sed
Another filtering program found on nearly every Unix system is sed, the stream editor. It is called a
stream editor because it is intended as a filter, with text usually flowing from standard input, through
the utility, to standard output. Unlike the previously listed commands, sed is a programmable utility
with a range of capabilities. During processing, sed interprets instructions from a sed script,
processing the text according to those instructions. The script may be a single command or a longer
list of commands. It is important to understand sed and its use for Exam 101, although detailed
knowledge is not required or offered in this brief introduction.
The sed utility is usually used either to automate repetitive editing tasks or to process text in pipes of
Unix commands (see Objective 4). The scripts that sed executes can be single commands or more
complex lists of editing instructions. It is invoked using one of the following methods.
sed
Syntax
sed [options] 'command1' [files]
sed [options] -e 'command1' [-e 'command2'...] [files]
sed [options] -f script [files]
Description
The first form invokes sed with a one-line command1. The second form invokes sed with two (or
more) commands. Note that in this case the -e parameter is required for all commands specified. The
commands are specified in quotes to prevent the shell from interpreting and expanding them. The
last form instructs sed to take editing commands from file script (which does not need to be
executable). In all cases, if files are not specified, input is taken from standard input. If multiple files
are specified, the edited output of each successive file is concatenated.
Frequently used options
-e cmd
The next argument is a command. This is not needed for single commands but is required for
all commands when multiple commands are specified.
-f file
The next argument is a script.
-g
Treat all substitutions as global.
The sed utility operates on text through the use of addresses and editing commands. The address is
used to locate lines of text to be operated upon, and editing commands modify text. During
operation, each line (that is, text separated by newlinecharacters) of input to sed is processed
individually and without regard to adjacent lines. If multiple editing commands are to be used
(through the use of a script file or multiple -e options), they are all applied in order to each line
before moving on to the next line.
Input to sed can come from standard input or from files. When input is received from standard input,
the original versions of the input text are lost. However, when input comes from files, the files
themselves are not changed by sed. The output of sed represents a modified version of the contents
of the files but does not affect them.
Addressing
Addresses in sed locate lines of text to which commands will be applied. The addresses can be:
A line number (note that sed counts lines continuously across multiple input files).
A line number with an interval. The form is n~s, where n is the starting line number and s is the
step, or interval, to apply. For example, to match every odd line in the input, the address
specification would be 1~2 (start at line 1 and match every two lines thereafter). This feature is
a GNU extension to sed.
The symbol $, indicating the last line of the last input file.
A regular expression delimited by forward slashes (/regex/ ). See Objective 7 for more
information on using regular expressions.
Zero, one, or two such addresses can be used with a sed command. If no addresses are given,
commands are applied to all input lines by default. If a single address is given, commands are applied
only to a line or lines matching the address. If two comma-separated addresses are given, an
inclusive range is implied. Finally, any address may be followed by the ! character, and commands
are applied to lines that do not match the address.
Commands
The sed command immediately follows the address specification if present. Commands generally
consist of a single letter or symbol, unless they have arguments. Following are some basic sed
editing commands to get you started.
d
Delete lines.
s
Make substitutions.This is a very popular sed command. The syntax is:
s/pattern/replacement/[flags]
The following flags can be specified for the s command:
g
Replace all instances of pattern, not just the first.
n
Replace n th instance of pattern; the default is 1.
p
Print the line if a successful substitution is done. Generally used with the -n command-line
option.
w file
Print the line to file if a successful substitution is done.
y
Translate characters. This command works in a fashion similar to the tr command, described
earlier.
Example 1
Delete lines 3 through 5 of file1:
$ sed '3,5d' file1
Example 2
Delete lines of file1 that contain a # at the beginning of the line:
$ sed '/^#/d' file1
Example 3
Translate characters:
y/abc/xyz/
Every instance of a is translated to x, b to y, and c to z.
Example 4
Write the @ symbol for all empty lines in file1 (that is, lines with only a newline character but nothing
more):
$ sed 's/^$/@/' file1
Example 5
Remove all double quotation marks from all lines in file1:
$ sed 's/"//g' file1
Example 6
Using sed commands from external file sedcmds, replace the third and fourth double quotation
marks with ( and ) on lines 1 through 10 in file1. Make no changes from line 11 to the end of the file.
Script file sedcmds contains:
1,10{
s/"/(/3
s/"/)/4
}
The command is executed using the -f option:
$ sed -f sedcmds file1
This example employs the positional flag for the s (substitute) command. The first of the two
commands substitutes ( for the third double-quote character. The next command substitutes ) for
the fourth double-quote character. Note, however, that the position count is interpreted
independently for each subsequent command in the script. This is important because each command
operates on the results of the commands preceding it. In this example, since the third double quote
has been replaced with ( , it is no longer counted as a double quote by the second command. Thus,
the second command will operate on the fifth double quote character in the original file1. If the input
line starts out with:
""""""
after the first command, which operates on the third double quote, the result is:
""("""
At this point, the numbering of the double-quote characters has changed, and the fourth double
quote in the line is now the fifth character. Thus, after the second command executes, the output is:
""(")"
Discovering Diverse Content Through
Random Scribd Documents
was intended as a text or handbook for the Ráwí or professional
story-teller, who would declaim the recitative in quasi-conversational
tones, would intone the Saj’a and would chant the metrical portions
to the twanging of the Rabábah or one-stringed viol. The Reviewer
declares that the original has many such passages; but why does he
not tell the reader that almost the whole Koran, and indeed all
classical Arab prose, is composed in such “jingle”? “Doubtfully
pleasing in the Arabic,” it may “sound the reverse of melodious in
our own tongue” (p. 282); yet no one finds fault with it in the older
English authors (Terminal Essay, p. 256), and all praised the free use
of it in Eastwick’s “Gulistán.” Torrens, Lane and Payne deliberately
rejected it, each for his own and several reason; Torrens because he
never dreamt of the application; Lane, because his scanty
knowledge of English stood in his way; and Payne because he aimed
at a severely classical style, which could only lose grace, vigour and
harmony by such exotic decoration. In these matters every writer
has an undoubted right to carry out his own view, remembering the
while that it is impossible to please all tastes. I imitated the Saj’a,
because I held it to be an essential part of the work, and of my fifty
reviewers none save the Edinburgh considered the reproduction of
the original manner aught save a success. I care only to satisfy
those whose judgment is satisfactory: “the abuse and contempt of
ignorant writers hurts me very little” as Darwin says (iii. 88), and we
all hold with Don Quixote that, es mejor ser loado de los pocos
sabios, que burlado de los muchos necios.
“This amusement (of reproducing the Saj’a) maybe carried to any
length (how?), and we do not see why Captain Burton neglects the
metre of the poetry, or divides his translation into sentences by
stops, or permits any break in the continuity of the narrative, since
none such exists in the Arabic” (p. 182). My reply is that I neglect
the original metres first and chiefly because I do not care to “caper
in fetters,” as said Drummond of Hawthornden; and, secondly,
because many of them are unfamiliar and consequently unpleasant
to English ears. The exceptions are mostly two, the Rajaz (Anapæsts
and Iambs, Terminal Essay, x. 294), and the Tawíl or long measure
(ibid. pp. 282, 296), which Mr. Lyall (Translations of Ancient Arab.
Poetry, p. xlix.) compares with “Abt Vogler,”
And there! ye have heard and seen: consider and bow the head.
This metre greatly outnumbers all others in The Nights; but its lilting
measure by no means suits every theme and in English it is apt to
wax monotonous.
“The following example of a literal rendering which Mr. Payne
adduces (vol. ix. 381: comp. my vol. v. 66) in order to show the
difficulty of turning the phraseology of the original into good English,
should have served Captain Burton as a model, and we are surprised
he has not adopted so charmingly cumbrous a style” (p. 102). I shall
quote the whole passage in question and shall show that by the
most unimportant changes, omissions and transpositions, without
losing a word, the whole becomes excellent English, and falls far
behind the Reviewer’s style in the contention for “cumbrousness”:—
“When morrowed the morning he bedabbled his feet with the water they twain
had expressed from the herb and, going-down to the sea, went thereupon walking
days and nights, he wondering the while at the horrors of the ocean and the
marvels and rarities thereof. And he ceased not faring over the face of the waters
till he arrived at an island as indeed it were Paradise. So Bulukiya went up thereto
and fell to wondering thereanent and at the beauties thereof; and he found it a
great island whose dust was saffron and its gravel were cornelian and precious
stones: its edges were gelsomine and the growth was the goodliest of the trees
and the brightest of the scented herbs and the sweetest of them. Its rivulets were
a-flowing; its brushwood was of the Comorin aloe and the Sumatran lign-aloes; its
reeds were sugar-canes and round about it bloomed rose and narcissus and
amaranth and gilliflower and chamomile and lily and violet, all therein being of
several kinds and different tints. The birds warbled upon those trees and the
whole island was fair of attributes and spacious of sides and abundant of good
things, comprising in fine all of beauty and loveliness,” etc. (Payne, vol. ix. p. 381).
The Reviewer cites in his list, but evidently has not read, the “Tales
from the Arabic,” etc., printed as a sequel to The Nights, or he would
have known that Mr. Payne, for the second part of his work,
deliberately adopted a style literal as that above-quoted because it
was the liveliest copy of the original.
We now come to the crucial matter of my version, the annotative
concerning which this “decent gentleman,” as we suppose this critic
would entitle himself (p. 185) finds a fair channel of discharge for
vituperative rhetoric. But before entering upon this subject I must be
allowed to repeat a twice-told tale and once more to give the raison
d’être of my long labour. When a friend asked me point-blank why I
was bringing out my translation so soon after another and a most
scholarly version, my reply was as follows:—“Sundry students of
Orientalism assure me that they are anxious to have the work in its
crudest and most realistic form. I have received letters saying, Let us
know (you who can) what the Arab of The Nights was: if good and
high-minded let us see him: if witty and humorous let us hear him: if
coarse and uncultivated, rude, childish and indecent, still let us have
him to the very letter. We want for once the genuine man. We would
have a mediæval Arab telling the tales and traditions with the lays
and legends of his own land in his own way, and showing the world
what he has remained and how he has survived to this day, while we
Westerns have progressed in culture and refinement. Above all
things give us the naïve and plain-spoken language of the original—
such a contrast with the English of our times—and show us, by the
side of these enfantillages, the accumulated wit and wisdom, life-
knowledge and experience of an old-world race. We want also the
technique of the Recueil, its division into nights, its monorhyme, in
fact everything that gives it cachet and character.” Now I could
satisfy the longing, which is legitimate enough, only by annotation,
by a running commentary, as it were, enabling the student to read
between the lines and to understand hints and innuendoes that
would otherwise have passed by wholly unheeded. I determined that
subscribers should find in my book what does not occur in any other,
making it a repertory of Eastern knowledge in its esoteric phase, by
no means intended for the many-headed but solely for the few who
are not too wise to learn or so ignorant as to ignore their own
ignorance. I regretted to display the gross and bestial vices of the
original, in the rare places where obscenity becomes rampant, but
not the less I held it my duty to translate the text word for word,
instead of garbling it and mangling it by perversion and castration.
My rendering (I promised) would be something novel, wholly
different from all other versions, and it would leave very little for any
future interpreter.[454]
And I resolved that, in case of the spiteful philanthropy and the rabid
pornophobic suggestion of certain ornaments of the Home-Press
being acted upon, to appear in Court with my version of The Nights
in one hand and bearing in the other the Bible (especially the Old
Testament, a free translation from an ancient Oriental work) and
Shakespeare, with Petronius Arbiter and Rabelais by way of support
and reserve. The two former are printed by millions; they find their
way into the hands of children, and they are the twin columns which
support the scanty edifice of our universal home-reading. The
Arbiter is sotadical as Abú Nowás and the Curé of Meudon is
surpassing in what appears uncleanness to the eye of outsight not of
insight. Yet both have been translated textually and literally by
eminent Englishmen and gentlemen, and have been printed and
published as an “extra series” by Mr. Bohn’s most respectable firm
and sold by Messieurs Bell and Daldy. And if The Nights are to be
bowdlerised for students, why not, I again ask, mutilate Plato and
Juvenal, the Romances of the Middle Ages, Boccaccio and Petrarch
and the Elizabethan dramatists one and all? What hypocrisy to
blaterate about The Nights in presence of such triumphs of the
Natural! How absurd to swallow such camels and to strain at my
midge!
But I had another object while making the notes a Repertory of
Eastern knowledge in its esoteric form (Foreword p. xix). Having
failed to free the Anthropological Society from the fetters of
mauvaise honte and the mock-modesty which compels travellers and
ethnological students to keep silence concerning one side of human
nature (and that side the most interesting to mankind), I proposed
to supply the want in these pages. The England of our day would
fain bring up both sexes and keep all ages in profound ignorance of
sexual and intersexual relations; and the consequences of that
imbecility are peculiarly cruel and afflicting. How often do we hear
women in Society lamenting that they have absolutely no knowledge
of their own physiology; and at what heavy price must this fruit of
the knowledge-tree be bought by the young first entering life. Shall
we ever understand that ignorance is not innocence? What an
absurdum is a veteran officer who has spent a quarter-century in the
East without learning that all Moslem women are circumcised, and
without a notion of how female circumcision is effected; without an
idea of the difference between the Jewish and the Moslem rite as
regards males; without an inkling of the Armenian process whereby
the cutting is concealed, and without the slightest theoretical
knowledge concerning the mental and spiritual effect of the
operation. Where then is the shame of teaching what it is shameful
not to have learnt? But the ultra-delicacy, the squeamishness of an
age which is by no means purer or more virtuous than its ruder
predecessors, has ended in trenching upon the ridiculous. Let us see
what the modern English woman and her Anglo-American sister
have become under the working of a mock-modesty which too often
acts cloak to real dévergondage; and how Respectability unmakes
what Nature made. She has feet but no “toes”; ankles but no
“calves”; knees but no “thighs”; a stomach but no “belly” nor
“bowels”; a heart but no “bladder” nor “groin”; a liver and no
“kidneys”; hips and no “haunches”; a bust and nor “backside” nor
“buttocks”: in fact, she is a monstrum, a figure fit only to frighten
the crows.
But the Edinburgh knows nothing of these things, and the “decent
gentleman,” like the lady who doth protest overmuch, persistently
fixes his eye upon a single side of the shield. “Probably no European
has ever gathered such an appalling collection of degrading customs
and statistics of vice as is contained in Captain Burton’s translation of
the ‘Arabian Nights’” (p. 185). He finds in the case of Mr. Payne, like
myself, “no adequate justification for flooding the world (!) with an
ocean of filth” (ibid.) showing that he also can be (as said the past-
master of catchwords, the primus verborum artifex) “an interested
rhetorician inebriated with the exuberance of his own verbosity.” But
audi alteram partem—my view of the question. I have no apology to
make for the details offered to the students of Moslem usages and
customs, who will find in them much to learn and more to suggest
the necessity of learning. On no wise ashamed am I of lecturing
upon these esoteric matters, the most important to humanity, at a
time when their absence from the novel of modern society veils with
a double gloom the night-side of human nature. Nay, I take pride to
myself for so doing in the face of silly prejudice and miserable
hypocrisy, and I venture to hold myself in the light of a public
benefactor. In fact, I consider my labours as a legacy bequeathed to
my countrymen at a most critical time when England the puissantest
of Moslem powers is called upon, without adequate knowledge of
the Moslem’s inner life, to administer Egypt as well as to rule India.
And while Pharisee and Philister may be or may pretend to be
“shocked” and “horrified” by my pages, the sound common sense of
a public, which is slowly but surely emancipating itself from the
prudish and prurient reticences and the immodest and immoral
modesties of the early xixth century, will in good time do me, I am
convinced, full and ample justice.
In p. 184 the Reviewer sneers at me for writing “Roum” in lieu of
Rum or Rúm; but what would the latter have suggested to the
home-reader save a reference to the Jamaican drink? He also
corrects me (vol. v. 248) in the matter of the late Mr. Emanuel
Deutsch (p. 184), who excised “our Saviour” from the article on the
Talmud reprinted amongst his literary remains. The Reviewer, or
inspirer of the Review, let me own, knew more of Mr. Deutsch than
I, a simple acquaintance, could know; but perhaps he does not know
all, and if he did he probably would not publish his knowledge. The
truth is that Mr. Deutsch was, during his younger years, a liberal,
nay, a latitudinarian in religion, differing little from the so-styled
“Christian Unitarian.” But when failing health drove him to Egypt and
his hour drew nigh he became (and all honour to him!) the
scrupulous and even fanatical Hebrew of the Hebrews; he consorted
mainly with the followers and divines of his own faith, and it is said
that he ordered himself when dying to be taken out of bed and
placed upon the bare floor. The “Saviour” of the article was perhaps
written in his earlier phase of religious thought, and it was excised
as the end drew in sight.
“Captain Burton’s experience in the East seems to have obliterated
any (all?) sentiments of chivalry, for he is never weary of recording
disparaging estimates of women, and apparently delights in
discovering evidence of ‘feminine devilry’” (p. 184). This
argumentum ad feminam is sharpish practice, much after the
manner of the Christian “Fathers of the Church” who, themselves
vehemently doubting the existence of souls non-masculine, falsely
and foolishly ascribed the theory and its consequences to
Mohammed and the Moslems. And here the Persian proverb holds
good “Harf-i-kufr kufr níst”—to speak of blasphemy is not
blasphemous. Curious readers will consult the article “Woman” in my
Terminal Essay (x. 192), which alone refutes this silly scandal. I
never pretended to understand woman, and, as Balzac says, no
wonder man fails when He who created her was by no means
successful. But in The Nights we meet principally Egyptian maids,
matrons and widows, of whose “devilry” I cannot speak too highly,
and in this matter even the pudibund Lane is as free-spoken as
myself. Like the natives of warm, damp and malarious lowlands and
river-valleys adjacent to rugged and healthy uplands, such as
Mazanderán, Sind, Malabar and California, the passions and the
sexual powers of the females greatly exceed those of their males,
and hence a notable development of the crude form of polyandry
popularly termed whoredom. Nor have the women of the Nile-valley
improved under our rule. The last time I visited Cairo a Fellah
wench, big, burly and boisterous, threatened one morning, in a fine
new French avenue off the Ezbekiyah Gardens, to expose her person
unless bought off with a piastre. And generally the condition of
womenkind throughout the Nile-valley reminded me of that frantic
outbreak of debauchery which characterised Afghanistan during its
ill-judged occupation by Lord Auckland, and Sind after the conquest
by Sir Charles Napier.
“Captain Burton actually depends upon the respectable and
antiquated D’Herbelot for his information” (p. 184). This silly skit at
the two great French Orientalists, D’Herbelot and Galland, is indeed
worthy of a clique which, puff and struggle however much it will, can
never do a tithe of the good work found in the Bibliothèque
Orientale. The book was issued in an unfinished state; in many
points it has been superseded, during its life of a century and a half,
by modern studies, but it is still a mine of facts, and a revised edition
would be a boon to students. Again, I have consulted Prof. Palmer’s
work, and the publications of the Palæographical Society (p. 184);
but I nowhere find proofs that the Naskhi character (vol. i. 128) so
long preceded the Cufic which, amongst vulgar Moslems, is looked
upon like black letter in Europe. But Semitic epigraphy is only now
entering upon its second stage of study, the first being mere
tentative ignorance: about 80 years ago the illustrious De Sacy
proved, in a learned memoir, the non-existence of letters in Arabia
before the days of Mohammed. But Palmer,[455]
Halevy, Robertson
Smith, Doughty and Euting have changed all that, and Herr Eduard
Glaser of Prague is now bringing back from Sana’á some 390
Sabæan epigraphs—a mass of new-old literature.
And now, having passed in review, and having been much
scandalised by “the extravagant claims of the complete translations
over the Standard Version”—a term which properly applies only to
the Editio princeps, 3 vols. 8vo.—the Edinburgh delivers a parting
and insolent sting. “The different versions, however, have each its
proper destination—Galland for the nursery, Lane for the library,
Payne for the study, and Burton for the sewers” (p. 184). I need
hardly attempt to precise the ultimate and well-merited office of his
article: the gall in that ink may enable it hygienically to excel for
certain purposes the best of “curl-papers.” Then our critic passes to
the history of the work, concerning which nothing need be said: it is
bodily borrowed from Lane’s Preface (pp. ix.–xv.), and his Terminal
Review (iii. 735–47) with a few unimportant and uninteresting
details taken from Al-Makrízí, and probably from the studies of the
late Rogers Bey (pp. 191–92). Here the cult of the Uncle and Master
emerges most extravagantly. “It was Lane who first brought out the
importance of the ‘Arabian Nights’ as constituting a picture of
Moslem life and manners” (p. 192); thus wholly ignoring the claims
of Galland, to whom and whom alone the honour is due. But almost
every statement concerning the French Professor involves more or
less of lapse. “It was in 1704 that Antoine Galland, sometime of the
French embassy at Constantinople, but then professor at the Collège
de France, presented the world with the contents of an Arab
Manuscript which he had brought from Syria, and which bore the
title of ‘The Thousand Nights and One Night’” (p. 167), thus ignoring
the famous Il a fallu le faire venir de Syrie. At that time (1704)
Galland was still at Caen in the employ of “L’intendant Fouquet”; and
he brought with him no MS., as he himself expressly assures us in
Preface to his first volume. Here are two telling mistakes in one
page, and in the next (p. 168) we find “As a professed translation
Galland’s ‘Mille et une Nuits’ (N.B. the Frenchman always wrote Mille
et une Nuit,)[456]
is an audacious fraud.” It requires something more
than “audacity” to offer such misstatement even in the pages of the
Edinburgh, and can anything be falser than to declare “the whole of
the last fourteen tales have nothing whatever to do with the
‘Nights’”?
These bévues, which give us the fairest measure for the Reviewer’s
competence to review, are followed (p. 189) by a series of obsolete
assertions. “The highest authority on this point (the date) is the late
Mr. Lane, who states his unqualified conviction that the tales
represent the social life of mediæval Egypt, and he selects a period
approaching the close of the fifteenth century as the probable date
of collection, though some of the tales are, he believes, rather later”
(p. 189). Mr. Lane’s studies upon the subject were painfully
perfunctory. He distinctly states (Preface, p. xii.) that “the work was
commenced and completed by one man,” or a least that “one man
completed what another commenced.” With a marvellous want of
critical acumen he could not distinguish the vast difference of style
and diction, treatment and sentiments which at once strikes every
intelligent reader, and which proves incontestably that many hands
took part in the Great Saga-book. He speaks of “Galland’s very
imperfect MS.,” but he never took the trouble to inspect the three
volumes in question which are still in the Bibliothèque Nationale. And
when he opines that “it (the work) was most probably not
commenced earlier than the fifteenth century of our era” (Pref. p.
xiii.) M. Hermann Zotenberg, judging from the style of writing, would
attribute the MS. to the beginning[457]
of the xivth century. The
French Savant has printed a specimen page in his Histoire d’ ’Alâ al-
Dîn (p. 6; see my Suppl. vol. iii., Foreword p. ix.); and now, at the
request of sundry experts, he is preparing for publication other
proofs which confirm his opinion. We must correct Lane’s fifteenth
century to thirteenth century—a difference of only 200 years.[458]
After this unhappy excursus the Reviewer proceeds to offer a most
unintelligent estimate of the Great Recueil. “Enchantment” may be
“a constant motive,” but it is wholly secondary and subservient: “the
true and universal theme is love;” “‘all are but the ministers of love’
absolutely subordinate to the great theme” (p. 193). This is the
usual half-truth and whole unfact. Love and war, or rather war and
love, form the bases of all romantic fiction even as they are the
motor power of the myriad forms and fashions of dancing. This may
not appear from Lane’s mangled and mutilated version, which
carefully omits all the tales of chivalry and conquest as the History of
Gharíb and his brother ’Ajíb (vol. vi. 257) and that of Omar ibn Al-
Nu’umán, “which is, as a whole, so very unreadable” (p. 172) though
by no means more so than our European romances. But the reverse
is the case with the original composition. Again, “These romantic
lovers who will go through fire to meet each other, are not in
themselves interesting characters: it may be questioned whether
they have any character at all” (p. 195). “The story and not the
delineation of character is the essence of the ‘Arabian Nights’” (p.
196). I can only marvel at the utter want of comprehension and
appreciation with which this critic read what he wrote about: one
hemisphere of his brain must have been otherwise occupied and his
mental cecity makes him a phenomenon even amongst reviewers.
He thus ignores all the lofty morale of the work, its marvellous
pathos and humour, its tender sentiment and fine touches of
portraiture, the personal individuality and the nice discrimination
between the manifold heroes and heroines which combine to make it
a book for all time.
The critic ends his article with doing what critics should carefully
avoid to do. After shrewdly displaying his powers of invective and
depreciation he has submitted to his readers a sample of his own
workmanship. He persists in writing “Zobeyda,” “Khalifa,” “Aziza” (p.
194) and “Kahramana” (p. 199) without the terminal aspirate which,
in Arabic if not in Turkish, is a sine quâ non (see my Suppl. vol. v.
419). He preserves the pretentious blunder “The Khalif” (p. 193), a
word which does not exist in Arabic. He translates (p. 181), although
I have taught him to do better, “Hádimu ’l-Lizzáti wa Mufarriku ’l-
Jama’át,” by “Terminator of Delights and Separator of Companies”
instead of Destroyer of delights and Severer of societies. And lastly
he pads the end of his article (pp. 196–199) with five dreary extracts
from Lane (i. 372–373) who can be dull even when translating the
Immortal Barber.
The first quotation is so far changed that the peppering of commas
(three to the initial line of the original) disappears to the reader’s
gain, Lane’s textual date (App. 263) is also exchanged for that of the
notes (A.H. 653); and the “æra of Alexander,” A.M. 7320, an
absurdity which has its value in proving the worthlessness of such
chronology, is clean omitted, because Lane used the worthless Bul.
Edit. The latinisms due to Lane show here in force—“Looked for a
considerable time” (Maliyyan = for a long while); “there is an
announcement that presenteth itself to me” (a matter which hath
come to my knowledge), and “thou hast dissipated[459]
my mind”
(Azhakta rúhí = thou scatterest my wits, in the Calc. Edit.
Saghgharta rúhí = thou belittlest my mind). But even Lane never
wrote “I only required thee to shave my head”—the adverb thus
qualifying, as the ignoramus loves to do, the wrong verb—for “I
required thee only to shave my head.” In the second échantillon we
have “a piece of gold” as equivalent of a quarter-dinar and “for God’s
sake” which certainly does not preserve local colour. In No. 3 we find
“‘May God,’ said I,” etc.; “There is no deity but God! Mohammed is
God’s apostle!”. Here Allah ought invariably to be used, e.g.
“Mohammed is the Apostle of Allah,” unless the English name of the
Deity be absolutely required as in “There is no god but the God.” The
Moslem’s “Wa’lláhi” must not be rendered “By God,” a verbal
translation and an absolute non-equivalent; the terms Jehovah, Allah
and God and the use of them involving manifold fine distinctions. If
it be true that God made man, man in his turn made and mismade
God who thus becomes a Son of Man and a mere racial type. I need
not trouble my reader with further notices of these extracts whose
sole use is to show the phenomenal dullness of Lane’s latinised style:
I prefer even Torrens (p. 273).
“We have spoken severely with regard to the last” (my version) says
the Reviewer (p. 185) and verily I thank him therefor. Laudari ab
illaudato has never been my ambition. A writer so learned and so
disinterested could hurt my feelings and mortify my pride only by
approving me and praising me. Nor have I any desire to be exalted
in the pages of the Edinburgh, so famous for its incartades of old. As
Dryden says “he has done me all the honour that any man can
receive from him, which is to be railed at by him.” I am content to
share the vituperation of this veteran-incapable in company with the
poetaster George Gordon who suffered for “this Lord’s station;” with
that “burnisht fly in the pride of May,” Macaulay; and with the great
trio, Darwin, Huxley and Hooker, who also have been the butts of his
bitter and malignant abuse (April ’63 and April ’73). And lastly I have
no stomach for sweet words from the present Editor of the
Edinburgh, Mr. Henry Reeve, a cross and cross-grained old man
whose surly temper is equalled only by his ignoble jealousy of
another’s success. Let them bedevil the thin-skinned with their
godless ribaldry; for myself peu m’importe—my shoulders are broad
enough to bear all their envy, hatred and malice.
During the three years which have elapsed since I first began
printing my book I have not had often to complain of mere
gratuitous impertinence and a single exception deserves some
notice. The following lines which I addressed to The Academy
(August 11 ’88) will suffice to lay my case before my readers:—
THE BESTIAL ELEMENT IN MAN.
“One hesitates to dissent from so great an authority as Sir Richard Burton on all
that relates to the bestial element in man.” So writes (p. xli., Introduction to the
Fables of Pilpay), with uncalled for impertinence, Mr. Joseph Jacobs, who goes out
of his way to be offensive, and who confesses to having derived all his knowledge
of my views not from “the notorious Terminal Essay of the Nights,” but from the
excellent article by Mr. Thomas Davidson on “Beast-fables,” in Chambers’s
Cyclopædia, Edinburgh, 1888. This lofty standpoint of morality was probably
occupied for a reason by a writer who dedicates “To my dear wife” a volume rich
in anecdotes grivoises, and not poor in language the contrary of conventional.
However, I suffer from this Maccabee in good society together with Prof. Max
Müller (pp. xxvi. and xxxiii.), Mr. Clouston (pp. xxxiii. and xxxv.), Byron (p. xlvi.),
Theodor Benfey (p. xlvii.), Mr. W. G. Rutherford (p. xlviii.), and Bishop Lightfoot (p.
xlix.). All this eminent halfdozen is glanced at, with distinct and several sneers, in
a little volume which, rendered useless by lack of notes and index, must advertise
itself by the réclame of abuse.
As regards the reminiscence of Homo Darwiniensis by Homo Sapiens, doubtless it
would ex hypothesi be common to mankind. Yet to me Africa is the old home of
the Beast-fable, because Egypt was the inventor of the alphabet, the cradle of
letters, the preacher of animism and metempsychosis, and, generally, the source
of all human civilisation.
Richard F. Burton.
And now I must proceed a trifle further a-field and meet
THE CRITIC IN ANGLO-AMERICA.
The Boston Daily Advertiser (Jan. 26 ’86) contains the following
choice morceau which went the round of the Transatlantic Press:—
G. W. S. writes from London to the New York Tribune in regard to Captain Burton’s
notorious translation of the “Arabian Nights.” Of Captain Burton’s translation of
“The Arabian Nights,” two volumes have now appeared. Before anything had been
seen of them, I gave some account of this scheme, and of the material on which
he had worked, with a statement of the reasons which made all existing versions
unsatisfactory to the student, and incomplete. Captain Burton saw fit to reprint
these desultory paragraphs as a kind of circular or advertisement on his
forthcoming book. He did not think it necessary to ask leave to do this, nor did I
know to what use my letter had been put till it was too late to object. In any
ordinary case it would have been of no consequence, but Captain Burton’s version
is of such a character that I wish to state the facts, and to say that when I wrote
my letter I had never seen a line of his translation, and had no idea that what I
said of his plans would be used for the purpose it has been, or for any purpose
except to be printed in your columns. As it is, I am made to seem to give some
sort of approval to a book which I think offensive, and not only offensive, but
grossly and needlessly offensive. If anybody has been induced to subscribe for it
by what I wrote I regret it, and both to him and to myself I think this explanation
due.
Mr. Smalley is the London correspondent of the New York Tribune,
which represents Jupiter Tonans in the Western World. He may be
unable to write with independent tone—few Anglo-Americans can
afford to confront the crass and compound ignorance of a “free and
independent majority;”—but even he is not called upon solemnly to
state an untruth. Before using Mr. Smalley’s article as a circular, my
representative made a point of applying to him for permission, as he
indeed was bound to do by the simplest rules of courtesy. Mr.
Smalley replied at once, willingly granting the favour, as I can prove
by the note still in my possession; and presently, frightened by the
puny yelping of a few critical curs at home, he has the effrontery to
deny the fact.
In my last volumes I have been materially aided by two Anglo-
American friends MM. Thayer and Cotheal and I have often had
cause to thank the Tribune and the Herald of New York for
generously appreciating my labours. But no gratitude from me is due
to the small fry of the Transatlantic Press which has welcomed me
with spiteful little pars., mostly borrowed from unfriends in England
and mainly touching upon style and dollars. In the Mail Express of
New York (September 7, ’85) I read, “Captain Richard Burton,
traveller and translator, intends to make all the money that there
may be in his translation of the ‘Arabian Nights.’ * * * If he only fills
his list, and collects his money he will be in easy circumstances for
the remainder of his days.” In a subsequent issue (Oct. 24) readers
are told that I have been requested not to publish the rest of the
series under pain of legal prosecution. In the same paper (October
31, ’85: see also November 7, ’85) I find:—
The authorities have discovered where Capt. Burton’s “Thousand and One Nights”
is being printed, despite the author’s efforts to keep the place a secret, but are
undecided whether to suppress it or to permit the publication of the coming
volumes. Burton’s own foot-notes are so voluminous that they exceed the
letterpress of the text proper, and make up the bulk of the work.[460] The foulness
of the second volume of his translation places it at a much higher premium in the
market than the first.
The Tribune of Chicago (October 26, ’85) honours me by declaring
“It has been resolved to request Captain Burton not to publish the
rest of his translation of the ‘Thousand and One Nights,’ which is
really foul and slipshod as to style.” The New York Times (October 17
and November 9, ’85) merely echoes the spite of its English
confrère:—
Capt. Burton’s translation of the “Arabian Nights” bears the imprint “Benares.” Of
course the work never saw Benares. America, France, Belgium and Germany have
all been suggested as the place of printing, and now the Pall Mall Gazette affirms
that the work was done “north of the Tweed.” There is, without doubt, on British
soil, it says, “a press which year after year produces scores of obscene
publications.”
And the same is the case with the St. Louis Post Dispatch
(November 11, ’85); the Mail Express of New York (November 23,
’85); the Weekly Post of Boston (November 27, ’85) which again
revives a false report and with the Boston Herald (December 16,
’85). The Chicago Daily News (January 30, ’86) contains a malicious
sneer at the Kamashastra Society. The American Register (Paris, July
25, ’86) informs its clientèle, “If, as is generally supposed, Captain
Burton’s book is printed abroad, the probability is that every copy
will on arrival be confiscated as ‘indecent’ by the Custom-house.”
And to curtail a long list of similar fadaises I will quote the Bookmart
(of Pittsburg, Pa. U.S.A., October, ’86): “Sir Richard Burton’s ‘Nights’
are terribly in want of the fig-leaf, if anything less than a cabbage-
leaf will do, before they can be fit (fitted?) for family reading. It is
not possible (Is it not possible?) that by the time a household
selection has been sifted out of the great work, everything which
makes the originality and the value—such as it is—of Richard’s series
of volumes will have disappeared, and nothing will remain but his
diverting lunacies of style.” The Bookmart, I am informed, is edited
by one Halkett Lord, an unnaturalised Englishman who finds it pays
best to abuse everything and everyone English. And lastly the
Springfield Republican (April 5, ’88) assures me that I have
published “fully as much as the (his?) world wants of the ‘Nights’.”
In the case of “The Nights,” I am exposed to that peculiar Protestant
form of hypocrisy, so different from the Tartuffean original of
Catholicism, and still as mighty a motor force, throughout the length
and breadth of the North-American continent, as within the narrow
limits of England. There also as here it goes hand-in-hand with
“Respectability” to blind judgment and good sense.
A great surgeon of our day said (or is said to have said) in
addressing his students:—“Never forget, gentlemen, that you have
to deal with an ignorant public.” The dictum may fairly be extended
from medical knowledge to general information amongst the many-
headed of England; and the Publisher, when rejecting a too
recondite book, will repeat parrot-fashion, The English public is not a
learned body. Equally valid is the statement in the case of the Anglo-
American community which is still half-educated and very far from
being erudite. The vast country has produced a few men of great
and original genius, such as Emerson and Theodore Parker, Edgar
Allan Poe and Walt. Whitman; but the sum total is as yet too small
to leaven the mighty mass which learns its rudiments at school and
college and which finishes its education with the newspaper and the
lecture. When Emerson died it was said that the intellectual glory of
a continent had departed; but Edgar A. Poe, the peculiar poetic glory
of the States, the first Transatlantic who dared be himself and who
disdained to borrow from Schiller and Byron, the outlander poet
who, as Edgar Allan Poé, is now the prime favourite in France,
appears to be still under ban because he separated like Byron from
his spouse, and he led a manner of so-called “Bohemian” life.
Indeed the wide diffusion of letters in the States, that favourite
theme for boasting and bragging over the unenlightened and
analphabetic Old World, has tended only to exaggerate the defective
and disagreeable side of a national character lacking geniality and
bristling with prickly individuality. This disposition of mind, whose
favourable and laudable presentations are love of liberty and self-
reliance, began with the beginnings of American history. The
“Fathers,” Pilgrim and Puritan, who left their country for their
country’s good and their own, fled from lay tyranny and clerkly
oppression only to oppress and tyrannise over others in new and
distant homes. Hardly had a century and a half elapsed before the
sturdy colonists, who did not claim freedom but determined to keep
it, formally revolted and fought their way to absolute independence
—not, by-the-by, a feat whereof to be overproud when a whole
country rose unanimously against a handful of troops. The
movement, however, reacted powerfully upon the politics of Europe
which stood agape for change, and undoubtedly precipitated the
great French Revolution. As soon as the States became an empire,
their democratic and republican institutions at once attracted hosts
of emigrants from the Old World, thus peopling the land with a
selection of species: the active and the adventurous, the malcontent
and the malefactor readily expatriate themselves while the pauvre
diable remains at home. The potato-famine in Ireland (1848) gave
an overwhelming impetus to the exode of a race which had never
known a racial baptism; and, lastly, the Germans flying from the
conscription, the blood-tax of the Fatherland, carried with them over
the ocean a transcendentalism which has engendered the wildest
theories of socialism and communism. And the emigration process
still continues. Whole regions, like the rugged Bocche di Cattaro in
Dalmatia and pauper Iceland, are becoming depopulated: to me the
wonder is that a poor man ever consents to live out of America or a
rich man to live in it.
The result of such selection has been two-fold. The first appears in a
splendid self-esteem, a complacency, a confidence which passes all
bounds of the golden mean. “I am engrossed in calmly
contemplating the grandeur of my native country and her miraculous
growth,” writes to me an old literary friend. The feeling normally
breaks out in the grossest laudation of everything American. The
ultra-provincial twang which we still hear amongst the servant-
classes of Lancashire and Yorkshire, and which is so notable in the
nouveau riche, modified by traditional nasalisation and, as in
Australia, by climatic influences, is American and, therefore, the
purest of English utterances. The obsolete vocabulary—often
obsolete in England without just reason—contrasting with a modern
disfigured etymology which strips vocables of their genealogy and
history, is American and ergò admirably progressive. The spurious
facetiousness which deals mainly in mere jargon, words ill-spelt and
worse pronounced; in bizarre contrast of ideas, and in ultra-
Rabelaisian exaggeration, is American wit and humour—therefore
unsurpassable. The Newspaper Press, that great reflector of
nationalities, that prime expression of popular taste, too often of an
écœurant vulgarity, personal beyond all bounds of common decency,
sensational as a transpontine drama, is American; America is the
greatest nation upon earth’s face; ergò the daily sheet is setting-up
the standard of English speech and forming the language of the
Future, good and too good for all the world. This low standard of the
Press is the more regretable as its exalted duty is at present to solve
the highest problems social and industrial, such as co-operation in
labour, the development of fisheries, direct taxation versus indirect
and a host of enigmas which the young world, uncumbered by the
burdens of the Old World, alone shall unravel.
The second result is still more prejudicial and perilous. This is the
glorification of mediocrity, of the average man and woman whose
low standard must be a norm to statesman and publicist. Such cult
of the common and the ignoble is the more prejudicial because it
“wars against all distinction and against the sense of elevation to be
gained by respecting and admiring superiority.” Its characteristic
predominance in a race which, true to its Anglo-Saxon origin, bases
and builds the strongest opinions upon the weakest foundations,
hinders the higher Avatars of genius and interferes with the “chief
duty of a nation which is to produce great men.” It accounts for the
ever-incroaching reign of women in literature—meaning as a rule
cheap work and second-rate. And the main lack is not so much the
“thrill of awe,” which Goethe pronounces to be the best thing
humanity possesses, but that discipline of respect, that sense of
loyalty, not in its confined meaning of attachment to royalty, but in a
far higher and nobler signification, the recognising and welcoming
elevation and distinction whatever be the guise they may assume.
“The soul lives by admiration and hope and love.”
And here we see the shady side of the educational process, the
diffusion of elementary and superficial knowledge, of the veneer and
polish which mask, until chipped-off, the raw and unpolished
material lying hidden beneath them. A little learning is a dangerous
thing because it knows all and consequently it stands in the way of
learning more or much. Hence it is sorely impatient of novelty, of
improvement, of originality. It is intolerant of contradiction, irritable,
thin-skinned, and impatient of criticism, of a word spoken against it.
It is chargeable with the Law of Copyright, which is not only
legalised plunder of the foreigner, but is unfair, unjust and
ungenerous to native talent for the exclusive benefit of the short-
sighted many-headed. I am far from charging the United States with
the abomination called “International Copyright;” the English
publisher is as sturdy an enemy to “protection” as the Transatlantic
statesman; but we expect better things from a new people which
enjoys the heritage of European civilisation without the sufferings
accompanying the winning of it. This mediocrity has the furious,
unpardoning hatred of l’amour propre offensé. Even a word in favour
of my old friends the Mormons is an unpardonable offence: the
dwarfish and dwarfing demon “Respectability” has made their
barbarous treatment a burning shame to a so-called “free” country:
they are subjected to slights and wrongs only for practising
polygamy, an institution never condemned by Christ or the early
Christians. The calm and dispassionate judgments of Sir Lepel
Griffith and the late Matthew Arnold, who ventured to state, in
guarded language, that the boasted civilisation of the United States
was not quite perfect, resulted in the former being called a snob and
the latter a liar. English stolidity would only have smiled at the
criticism even had it been couched in the language of persiflage. And
when M. Max O’Rell traverses the statements of the two Englishmen
and exaggerates American civilisation, we must bear in mind first
that la vulgarité ne se traduit pas, and secondly, that the foes of our
foemen are our friends. Woe be to the man who refuses to fall down
and do worship before that brazen-faced idol (Eidolon Novi Mundi),
Public Opinion in the States; unless, indeed, his name be Brown and
he hail from Briggsville.
Some years ago I proposed to write a paper upon the reflex action
of Anglo-America upon England, using as a base the last edition of
Mrs. Trollope, who was compelled to confess that almost every
peculiarity which she had abused in her first issue had become
naturalised at home. Yankee cuteness has already displaced in a
marvellous way old English rectitude and plain-dealing; gambling on
the Stock Exchange, cornering, booms and trusts have invaded the
trading-classes from merchant-princes to shopkeepers and threaten,
at their actual rate of progress, not to leave us an honest man. But
now the student’s attention will be called to the great and ever-
growing influence of the New World upon the Old, and notably upon
Europe. Some 50,000 Americans annually visit the continent, they
are rapidly becoming the most important item of the floating
population, and in a few years they will number 500,000. Meanwhile
they are revolutionising all the old institutions; they are abolishing
the classical cicerone whose occupation is gone amongst a herd
which wants only to see streets and people: they greatly increase
the cost of travelling; they pay dollars in lieu of francs, and they are
satisfied with inferior treatment at superior prices:—hence the
American hotel abroad is carefully shunned by Englishmen and
natives. At home the “well-to-do-class” began by regarding their
kinsmen d’outre mer with contemptuous dislike; then they looked
upon them as a country squire would regard a junior branch which
has emigrated and has thriven by emigration; and now they are
welcomed in Society because they amuse and startle and stir up the
duller depths. But however warm may be private friendship between
Englishmen and Anglo-Americans there is no public sympathy nor is
any to be expected from the present generation. “New England does
not understand Old England and never will,” the reverse being
equally the fact. “The Millennium must come” says Darwin (ii. 387)
“before nations love each other:” I add that first Homo alalus seu
Pithecanthropus must become Homo Sapiens and cast off his moral
slough—egoism and ignorance. Mr. Cleveland, in order to efface the
foul stigma of being the “English President,” found it necessary to
adopt the strongest measures in the matter of “Fisheries;” and the
“Irish vote” must quadrennially be bought at the grave risk of
national complications. Despite the much-bewritten “brotherhood of
the two great English-speaking races of the world,” the old leaven of
cousinly ill-feeling, the jealousy which embitters the Pole against his
Russian congener, is still rampant. Uncle Sam actively dislikes John
Bull and dispraises England. An Anglo-American who has lived years
amongst us and in private intimacy must, when he returns home,
speak disparagingly of the old country unless he can afford the
expensive luxury of telling unpopular truths and of affronting Demos,
the hydraheaded.
But there are even now signs of better things in the Great Republic.
Mr. James R. Lowell, an authority (if there be any) upon the subject
of Democracy, after displaying its fine points and favourable aspects
in his addresses to English audiences, has at length had the
uncommon courage to discuss family affairs, and to teach Boston
and New York what “weaknesses and perils there may be in the
practical working of a system never before set in motion under such
favourable circumstances, nor on so grand a scale.” He is
emboldened to say firmly and aloud, despite the storming of false
and hollow self-praise, that American civilisation, so strong on the
material side, is sadly wanting on the other, and still lacks much to
make it morally acceptable or satisfactory. And we have home truths
concerning that Fool’s Paradise the glorification of the “average
man.” Every citizen of the world must wish full success to the
“Independents” (in politics) who sit at the feet of so wise and
patriotic a teacher.
And here I feel myself bound to offer some explanation concerning
THE HOUSEHOLD EDITION OF THE ARABIAN
NIGHTS,
lest any subscriber charge me, after contracting not to issue or to
allow the issue of a cheaper form, with the sharp practice which may
be styled
To keep the word of promise to our ear
And break it to our hope.
Hardly had my third volume of “The Nights” (proper) been issued to
my patrons when a benevolent subscriber, whose name I am bound
to conceal, apprised me that he had personal and precise
information concerning a project to pirate the production. England
and Anglo-America, be it observed, are the only self-styled civilised
countries in the world where an author’s brain-work is not held to be
his private property: his book is simply no book unless published and
entered, after a cost of seven presentation copies, at “Stationers’
Hall”—its only ægis. France, Italy and Austria treat such volumes as
private MSS.: here any dishonest house may reproduce them in
replica without the slightest regard to the writer’s rightful rights. In
my case this act of robbery was proposed by a German publisher
domiciled in London, supported by a Frenchman equally industrious,
who practises in Paris, and of whose sharp doings in money-matters
not a few Englishmen have had ample reason bitterly to complain.
This par nobile agreed to print in partnership an issue of handier
form and easier price than my edition, and their plan if carried out
would have seriously damaged the property of my subscribers: the
series which cost them £10 10s. would have fallen probably to one-
half value. The two pirates met by agreement in Paris, where the
design was duly discussed and determined; but, fortunately for me,
an unexpected obstacle barred the way. The London solicitor,
professionally consulted by the dishonest firm, gave his opinion that
such a work publicly issued would be a boon to the Society for the
Suppression of Vice, and would not escape the unsavoury attentions
of old Father Antic—the Law.
But, although these two men were deterred by probable
consequences, a bolder spirit might make light of them. I had never
intended to go beyond my original project; that is, of printing one
thousand copies and no more; nor did I believe that any cunning of
disguise could make “The Nights” presentable in conventionally
decent society. It was, however, represented to me by many whose
opinions I valued that thus and thus only the author and his
subscribers could be protected from impudent fraud, and finally an
unwilling consent was the result.
Mr. Justin Huntley McCarthy, a name well known in the annals of
contemporary literature, undertook the task of converting the grand
old barbarian into a family man to be received by the “best circles.”
His proofs, after due expurgation, were passed on to my wife, who I
may say has never read the original, and she struck out all that
appeared to her over-free, under the promise that no mother should
hesitate in allowing the book to her daughters. It would, perhaps,
surprise certain “modest gentlemen” and blatantly virtuous reviewers
that the amount of raw material excised from the text and the notes,
chiefly addressed to anthropologists and Orientalists, amounts to
only 215 pages out of a grand total numbering 3,156.
Between 1886 and 1888 appeared the revision in six pretty volumes,
bearing emblematic colours, virgin-white adorned with the golden
lilies of St. Joseph and the “chaste crescent of the young moon.” The
price also was reduced to the lowest (£3 3s.) under the idea that the
work would be welcome if not to families at any rate to libraries and
reading-rooms, for whose benefit the older translations are still
being reproduced. But the flattering tale of Hope again proved to be
a snare and a delusion; I had once more dispensed with the services
of Mr. Middleman, the publisher, and he naturally refused to aid and
abet the dangerous innovation. The hint went abroad that the book
belonged to the category which has borrowed a name from the
ingenious Mr. Bowdler, and vainly half a century of reviewers spoke
bravely in its praise. The public would have none of it: even innocent
girlhood tossed aside the chaste volumes in utter contempt, and
would not condescend to aught save the thing, the whole thing, and
nothing but the thing, unexpurgated and uncastrated. The result
was an unexpected and unpleasant study of modern taste in highly
respectable England. And the fact remains that of an edition which
began with a thousand copies only 457 were sold in the course of
two years. Next time I shall see my way more clearly to suit the
peculiar tastes and prepossessions of the reading world at home.
Before dismissing the subject of the Household Edition, I would offer
a few words of explanation on the part of the Editress. While
touching-up and trimming the somewhat hurried work of our friend,
Mr. McCarthy, she was compelled to accompany me abroad, and to
nurse me through a dangerous illness, which left but little time for
the heavy claims of business. Unable to superintend, with the care
required, the issue of her six volumes she entrusted the task to two
agents in whose good will and experience she had and still has the
fullest confidence; but the results were sundry letters of appeal and
indignation from subscribers touching matters wholly unknown and
unintelligible to her. If any mistakes have been made in matters of
detail she begs to express her sincerest regret, and to assure those
aggrieved that nothing was further from her intention than to show
discourtesy where she felt cordial gratitude was due.
Nothing now remains for me but the pleasant task of naming the
many friends and assistants to whom this sixteenth and last volume
has been inscribed. The late Reverend G. Percy Badger strongly
objected to the literal translation of “The Nights” (The Academy,
December 8, ’81); not the less, however, he assisted me in its
philology with all readiness. Dr. F. Grenfell Baker lent me ready and
valuable aid in the mechanical part of my hard labour. Mr. James F.
Blumhardt, a practical Orientalist and teacher of the Prakrit dialects
at Cambridge, englished for me the eight Gallandian tales
(Foreword, Supp. vol. iii.) from the various Hindostan versions. To
Mr. William H. Chandler, of Pembroke College, Oxford, I have
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

PDF
LPI Linux Certification in a Nutshell Third Edition Adam Haeder
PDF
LPI Linux Certification in a Nutshell Third Edition Adam Haeder
PDF
Lpi Linux Certification In A Nutshell In A Nutshell Oreilly Third Edition Ada...
PPT
Lpi lição 01 exam 102 objectives
PPT
Lpi lição 01 exam 101 objectives
PDF
Linux training
PDF
Lpi 101 study_guide
PDF
Linux lpi101
LPI Linux Certification in a Nutshell Third Edition Adam Haeder
LPI Linux Certification in a Nutshell Third Edition Adam Haeder
Lpi Linux Certification In A Nutshell In A Nutshell Oreilly Third Edition Ada...
Lpi lição 01 exam 102 objectives
Lpi lição 01 exam 101 objectives
Linux training
Lpi 101 study_guide
Linux lpi101

Similar to LPI Linux certification in a nutshell a desktop quick reference 1st ed Edition Jeffrey Dean (20)

PDF
fundamentals of linux
PDF
fundamentals of linux
PDF
fundamentals of linux
PDF
Gnu study guide linux admin 1 (lab work lpi 102) v 0.2
PDF
Lpi Part 1 Linux Fundamentals
PDF
CompTIA Linux Study Guide Exam XK0 005 5th Edition Richard Blum Christine Bre...
PDF
Gnu study guide linux admin 1 (lab work lpi 101) v 0.2
PDF
Lpi Part 3 Intermediate Administration
PDF
Lpi Part 2 Basic Administration
PDF
Understanding The Linux Kernel 1st Edition Daniel Pierre Bovet
PDF
Administer and Secure Enterprise Linux 2021st Edition Russell Overton
PDF
Administer and Secure Enterprise Linux 2021st Edition Russell Overton
PDF
Buy ebook Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka c...
PDF
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
PDF
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
PPTX
Network_lecture_for_students_whom_intersted.pptx
PDF
Linux fundamentals
PDF
Linux System Programming 1st Edition Robert Love
DOC
Linux administration training from hyderabad
PDF
Rhce syllabus
fundamentals of linux
fundamentals of linux
fundamentals of linux
Gnu study guide linux admin 1 (lab work lpi 102) v 0.2
Lpi Part 1 Linux Fundamentals
CompTIA Linux Study Guide Exam XK0 005 5th Edition Richard Blum Christine Bre...
Gnu study guide linux admin 1 (lab work lpi 101) v 0.2
Lpi Part 3 Intermediate Administration
Lpi Part 2 Basic Administration
Understanding The Linux Kernel 1st Edition Daniel Pierre Bovet
Administer and Secure Enterprise Linux 2021st Edition Russell Overton
Administer and Secure Enterprise Linux 2021st Edition Russell Overton
Buy ebook Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka c...
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
Linux Administration: A Beginner's Guide 8th Edition Wale Soyinka
Network_lecture_for_students_whom_intersted.pptx
Linux fundamentals
Linux System Programming 1st Edition Robert Love
Linux administration training from hyderabad
Rhce syllabus
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
master seminar digital applications in india
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Institutional Correction lecture only . . .
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Types and Its function , kingdom of life
PPTX
Lesson notes of climatology university.
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
VCE English Exam - Section C Student Revision Booklet
Final Presentation General Medicine 03-08-2024.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
master seminar digital applications in india
2.FourierTransform-ShortQuestionswithAnswers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Computing-Curriculum for Schools in Ghana
Supply Chain Operations Speaking Notes -ICLT Program
Institutional Correction lecture only . . .
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPH.pptx obstetrics and gynecology in nursing
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pre independence Education in Inndia.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Types and Its function , kingdom of life
Lesson notes of climatology university.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
VCE English Exam - Section C Student Revision Booklet
Ad

LPI Linux certification in a nutshell a desktop quick reference 1st ed Edition Jeffrey Dean

  • 1. LPI Linux certification in a nutshell a desktop quick reference 1st ed Edition Jeffrey Dean pdf download https://ebookgate.com/product/lpi-linux-certification-in-a- nutshell-a-desktop-quick-reference-1st-ed-edition-jeffrey-dean/ Get Instant Ebook Downloads – Browse at https://ebookgate.com
  • 2. Get Your Digital Files Instantly: PDF, ePub, MOBI and More Quick Digital Downloads: PDF, ePub, MOBI and Other Formats J2ME in a nutshell a desktop quick reference 1st ed Edition Kim Topley https://ebookgate.com/product/j2me-in-a-nutshell-a-desktop-quick- reference-1st-ed-edition-kim-topley/ PHP in a Nutshell A Desktop Quick Reference 1st Edition Paul Hudson https://ebookgate.com/product/php-in-a-nutshell-a-desktop-quick- reference-1st-edition-paul-hudson/ SQL in a Nutshell A Desktop Quick Reference Guide In a Nutshell O Reilly 3rd Edition Kevin Kline https://ebookgate.com/product/sql-in-a-nutshell-a-desktop-quick- reference-guide-in-a-nutshell-o-reilly-3rd-edition-kevin-kline/ Linux Kernel in a Nutshell In a Nutshell O Reilly 1st Edition Greg Kroah-Hartman https://ebookgate.com/product/linux-kernel-in-a-nutshell-in-a- nutshell-o-reilly-1st-edition-greg-kroah-hartman/
  • 3. MySQL in a Nutshell 1st Edition Dyer https://ebookgate.com/product/mysql-in-a-nutshell-1st-edition- dyer/ grep Pocket Reference A Quick Pocket Reference for a Utility Every Unix User Needs Pocket Reference O Reilly 1st Edition Bambenek https://ebookgate.com/product/grep-pocket-reference-a-quick- pocket-reference-for-a-utility-every-unix-user-needs-pocket- reference-o-reilly-1st-edition-bambenek/ Current Diagnosis and Treatment A Quick Reference for the General Practitioner 3rd Edition James O. Woolliscroft (Ed.) https://ebookgate.com/product/current-diagnosis-and-treatment-a- quick-reference-for-the-general-practitioner-3rd-edition-james-o- woolliscroft-ed/ Red Hat Linux the complete reference 2. ed Edition Petersen https://ebookgate.com/product/red-hat-linux-the-complete- reference-2-ed-edition-petersen/ A Dictionary of Plant Sciences Oxford Quick Reference 4th Edition Michael Allaby https://ebookgate.com/product/a-dictionary-of-plant-sciences- oxford-quick-reference-4th-edition-michael-allaby/
  • 4. • Table of Contents LPI Linux Certification in a Nutshell By Jeff Dean Publisher : O'Reilly Pub Date : May 2001 ISBN : 1-56592-748-6 Pages : 570 Slots : 1 Preface The Linux Professional Institute Audience for This Book Organization Conventions Used in This Book How to Contact Us Acknowledgments Part I: General Linux Exam 101 Chapter 1. Exam 101 Overview Chapter 2. Exam 101 Study Guide Section 2.1. Exam Preparation Chapter 3. GNU and Unix Commands (Topic 1.3) Section 3.1. Objective 1: Work Effectively on the Unix Command Line Section 3.2. Objective 2: Process Text Streams Using Text-Processing Filters Section 3.3. Objective 3: Perform Basic File Management Section 3.4. Objective 4: Use Unix Streams, Pipes,and Redirects Section 3.5. Objective 5: Create, Monitor, and Kill Processes Section 3.6. Objective 6: Modify Process Execution Priorities Section 3.7. Objective 7: Making Use of Regular Expressions Chapter 4. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4) Section 4.1. Objective 1: Create Partitions and Filesystems Section 4.2. Objective 2: Maintain the Integrity of Filesystems Section 4.3. Objective 3: Control Filesystem Mounting and Unmounting Section 4.4. Objective 4: Set and View Disk Quotas Section 4.5. Objective 5: Use File Permissions to Control Access to Files Section 4.6. Objective 6: Manage File Ownership Section 4.7. Objective 7: Create and Change Hard and Symbolic Links Section 4.8. Objective 8: Find System Files and Place Files in the Correct Location Chapter 5. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6) Section 5.1. Objective 1: Boot the System Section 5.2. Objective 2: Change Runlevels and Shutdown or Reboot the System Chapter 6. Documentation (Topic 1.8) Section 6.1. Objective 1: Use and Manage Local System Documentation
  • 5. Section 6.2. Objective 2: Find Linux Documentation on the Internet Section 6.3. Objective 3: Write System Documentation Section 6.4. Objective 4: Provide User Support Chapter 7. Administrative Tasks (Topic 2.11) Section 7.1. Objective 1: Manage Users and Group Accounts Section 7.2. Objective 2: Tune the User Environment Section 7.3. Objective 3: Configure and Use System Log Files Section 7.4. Objective 4: Automate System Administration Tasks Section 7.5. Objective 5: Maintain an Effective Data Backup Strategy Chapter 8. Exam 101 Review Questions and Exercises Section 8.1. GNU and Unix Commands (Topic 1.3) Section 8.2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4) Section 8.3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6) Section 8.4. Documentation (Topic 1.8) Section 8.5. Administrative Tasks (Topic 2.11) Chapter 9. Exam 101 Practice Test Section 9.1. Questions Section 9.2. Answers Chapter 10. Exam 101 Highlighter's Index Section 10.1. GNU and Unix Commands (Topic 1.3) Section 10.2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4) Section 10.3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6) Section 10.4. Documentation (Topic 1.8) Section 10.5. Administrative Tasks (Topic 2.11) Part II: General Linux Exam 102 Chapter 11. Exam 102 Overview Chapter 12. Exam 102 Study Guide Section 12.1. Exam Preparation Chapter 13. Hardware and Architecture (Topic 1.1) Section 13.1. Objective 1: Configure Fundamental System Hardware Section 13.2. Objective 2: Set Up SCSI and NIC Devices Section 13.3. Objective 3: Configure Modems and Sound Cards Chapter 14. Linux Installation and Package Management (Topic 2.2) Section 14.1. Objective 1: Design a Hard Disk Layout Section 14.2. Objective 2: Install a Boot Manager Section 14.3. Objective 3: Make and Install Programs from Source Section 14.4. Objective 4: Manage Shared Libraries Section 14.5. Objective 5: Use Debian Package Management Section 14.6. Objective 6: Use Red Hat Package Manager (RPM) Chapter 15. Kernel (Topic 1.5) Section 15.1. Objective 1: Manage Kernel Modules at Runtime Section 15.2. Objective 2: Reconfigure, Build, and Install a Custom Kernel and Modules
  • 6. Chapter 16. Text-Editing, Processing, and Printing (Topic 1.7) Section 16.1. Objective 1: Perform Basic File Editing Operations Using vi Section 16.2. Objective 2: Manage Printers and Print Queues Section 16.3. Objective 3: Print Files Section 16.4. Objective 4: Install and Configure Local and Remote Printers Chapter 17. Shells, Scripting, Programming, and Compiling (Topic 1.9) Section 17.1. Objective 1: Customize and Use the Shell Environment Section 17.2. Objective 2: Customize or Write Simple Scripts Chapter 18. X (Topic 2.10) Section 18.1. An Overview of X Section 18.2. Objective 1: Install and Configure XFree86 Section 18.3. Objective 2: Set Up xdm Section 18.4. Objective 3: Identify and Terminate Runaway X Applications Section 18.5. Objective 4: Install and Customize a Window Manager Environment Chapter 19. Networking Fundamentals (Topic 1.12) Section 19.1. Objective 1: Fundamentals of TCP/IP Section 19.2. Objective 3: TCP/IP Troubleshooting and Configuration Section 19.3. Objective 4: Configure and Use PPP Chapter 20. Networking Services (Topic 1.13) Section 20.1. Objective 1: Configure and Manage inetd and Related Services Section 20.2. Objective 2: Operate and Perform Basic Configuration of sendmail Section 20.3. Objective 3: Operate and Perform Basic Configuration of Apache Section 20.4. Objective 4: Properly Manage the NFS, SMB, and NMB Daemons Section 20.5. Objective 5: Set Up and Configure Basic DNS Services Chapter 21. Security (Topic 1.14) Section 21.1. Objective 1: Perform Security Administration Tasks Section 21.2. Objective 2: Set Up Host Security Section 21.3. Objective 3: Set Up User-Level Security Chapter 22. Exam 102 Review Questions and Exercises Section 22.1. Hardware and Architecture ( Topic 1.1) Section 22.2. Linux Installation and Package Management ( Topic 2.2) Section 22.3. Kernel ( Topic 1.5) Section 22.4. Text Editing, Processing, and Printing ( Topic 1.7) Section 22.5. Shells, Scripting, Programming, and Compiling (Topic 1.9) Section 22.6. X (Topic 2.10) Section 22.7. Networking Fundamentals (Topic 1.12) Section 22.8. Networking Services (Topic 1.13) Section 22.9. Security (Topic 1.14) Chapter 23. Exam 102 Practice Test Section 23.1. Questions Section 23.2. Answers Chapter 24. Exam 102 Highlighter's Index
  • 7. Section 24.1. Hardware and Architecture Section 24.2. Linux Installation and Package Management Section 24.3. Kernel Section 24.4. Text-Editing, Processing, and Printing Section 24.5. Shells, Scripting, Programming, and Compiling Section 24.6. X Section 24.7. Networking Fundamentals Section 24.8. Networking Services Section 24.9. Security Glossary
  • 8. Book: LPI Linux Certification in a Nutshell Section: Preface The Linux Professional Institute The Linux Professional Institute, or LPI (http://www.lpi.org/), is a nonprofit organization formed around the notion of certifying Linux administrators through a sort of open source process. The LPI seeks input from the public for its exam Objectives and questions, and anyone is welcome to participate. It has both paid and volunteer staff and receives funding from some major names in the computer industry. The result is a vendor-neutral, publicly developed program that is offered at a reasonable price. The LPI organizes its Linux Professional Institute Certification (LPIC) series into three levels: LPIC Levels 1, 2, and 3. Each level consists of two exams that are priced at $100 each. This book covers the LPIC Level 1 exams, numbers 101 and 102. LPI Level 1 Exams The LPI offers its exams through Virtual University Enterprises (http://www.vue.com/). You may establish an online account with VUE and resister for the exams using the company's web site. VUE has more than two thousand testing centers worldwide, making the exams accessible in most areas. The exams are presented in English using a PC-based automated examination program. Exam questions are presented in multiple-choice single-answer, multiple-choice multiple-answer, and fill-in- the-blank styles. However, a majority of the questions on the exams are multiple-choice single- answer. Level 1 is aimed at junior to midlevel Linux administrators, who should be comfortable with Linux at the command line as well as capable of performing simple tasks, including system installation and troubleshooting. While Exams 101 and 102 are not constructed to be difficult or misleading, together they encompass a wide body of material, making preparation important for success even for experienced administrators. Each of the exams covers a series of Topics, which are numbered using a level.topic notation (i.e., 1.2, 2.5, etc.). In the LPI's early stages of development, Topics were assigned to exams based on a different scheme than we see today. When the scheme changed, the Topics were redistributed to Exams 101 and 102, but the pairing of Topic numbers to exams was dropped. As a result, we have 1.x and 2.x Topics in both Level 1 Exams. Each Topic contains a series of Objectives covering specific areas of expertise. The Level 1 Topics are distributed between the two exams to create tests of similar length and difficulty without subject matter overlap. As a result, there's no requirement for or advantage to taking them in sequence. Exam 101 tests five Topics in approximately 60 questions, and Exam 102 tests nine Topics in approximately 72 questions. Each exam is limited to 90 minutes.
  • 9. Book: LPI Linux Certification in a Nutshell Section: Preface Audience for This Book The primary audience for this book is, of course, candidates seeking the LPIC Level 1 certification. These may range from administrators of other operating systems looking for a Linux certification to complement an MCSE or other certification to Unix administrators wary of a growing pool of Linux- certified job applicants. In any case, this book will help you with the specific information you require to be successful with the Level 1 exams. Due to the breadth of knowledge required by the LPI Objectives and the book's 1-to-1 coverage, it also makes an excellent reference for skills and methods required for the day-to-day use of Linux. If you have a basic working understanding of Linux administration, the material in this book will help you fill in gaps in your knowledge while at the same time preparing you for the LPI exams, should you choose to take them. This book should also prove to be a valuable introduction for new Linux users and administrators looking for a broad, detailed introduction to Linux. Part of the LPI exam-creation process includes a survey of Linux professionals in the field. The survey results drive much of the content found on the exams. Therefore, unlike general-purpose introductory Linux books, all of the information in this book applies directly to running Linux in the real world.
  • 10. Book: LPI Linux Certification in a Nutshell Section: Preface Organization This book is designed to exactly follow the Topics and Objectives established by the LPI for Exams 101 and 102. That means that the presentation doesn't look like any other Linux book you've read. Instead, you can directly track the LPI Objectives and easily measure your progress as you prepare. The book is presented in two parts. Part I covers Exam 101 and Part II covers Exam 102. Each part contains sections dedicated to the LPI Topics, and each of those sections contains information on all of the Objectives set forth for the Topic. In addition, each part contains a practice exam (with answers), review questions and exercises, and a handy "highlighter's index" that can help you review important details. There is also a glossary at the back of the book, which you can use to help familiarize yourself with different Linux-related terms. Parts 1 and 2: LPI Level 1 Exams 101 and 201 Part I and Part II each contain these sections: Exam overview Here you find an introduction to the exam along with details about the format of the questions. Study guide This section offers a few tips for preparing for the LPI Level 1 exams and introduces the Objectives contained in the Topic sections that follow. Topic sections A separate section covers each of the Topic areas on the exam (five for Exam 101, nine for Exam 102). These sections provide background information and in-depth coverage for each Objective, with On the Exam tips dispersed throughout. Review questions and exercises This section reinforces important study areas with review questions. The purpose of this section is to provide you with a series of exercises that can be used on a running Linux system to give you valuable hands-on experience before you take the Level 1 exams. Practice test The practice test is designed to be similar in format and content to the actual LPI exams. You should be able to attain at least an 80 percent score on the sample test before attempting the live exam. Highlighter's index This unique section contains highlights and important facts culled from the Topic sections. You
  • 11. can use this as review and reference material prior to taking the actual exams. Each Objective set forth by the LPI is assigned a numeric weight, which acts as an indicator of the importance of the Objective. Weights run between 1 and 10, with higher numbers indicating more importance. An Objective carrying a weight of 1 can be considered relatively unimportant and isn't likely to be covered in much depth on the exam. Objectives with larger weights are sure to be covered on the exam, so you should study these Topics closely. The weights of the Objectives are provided at the beginning of each Topic section.
  • 12. Book: LPI Linux Certification in a Nutshell Section: Preface Conventions Used in This Book This desktop quick reference follows certain typographical conventions: Bold Used for commands, programs, and options. All terms shown in bold are typed literally. Italic Used to show arguments and variables that should be replaced with user-supplied values. Italic is also used to indicate filenames and directories and to highlight comments in examples. Constant Width Used to show the contents of files or the output from commands. Constant Width Bold Used in examples and tables to show commands or other text that should be typed literally by the user. Constant Width Italic Used in examples and tables to show text that should be replaced with user-supplied values. #, $ Used in some examples as the root shell prompt (#) and as the user prompt ($) under the Bourne or bash shell. On the Exam These provide information about areas you should focus on when studying for the exam. These signify a tip, suggestion, or general note. These indicate a warning or caution. A final word about syntax: in many cases, the space between an option and its argument can be omitted. In other cases, the spacing (or lack of spacing) must be followed strictly. For example, -wn (no intervening space) might be interpreted differently from -w n. It's important to notice the spacing used in option syntax.
  • 14. Book: LPI Linux Certification in a Nutshell Section: Preface How to Contact Us We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made mistakes!). As a reader of this book and as an LPI examinee, you can help us to improve future editions. Please let us know about any errors you find, as well as your suggestions for future editions, by writing to: O'Reilly & Associates, Inc. 101 Morris Street Sebastopol, CA 95472 (800) 998-9938 (in the U.S. or Canada) (707) 829-0515 (international/local) (707) 829-0104 (fax) You can also send us messages electronically. To be put on the mailing list or to request a catalog, send email to: info@oreilly.com To ask technical questions or comment on the book, send email to: bookquestions@ora.com We have a web site for the book, where we'll list examples, errata, and any plans for future editions. The site also includes a link to a forum where you can discuss the book with the author and other readers. You can access this site at: http://www.oreilly.com/catalog/lpicertnut For more information about this book and others, see the O'Reilly web site: http://www.oreilly.com/ If you have taken one or both of the LPIC Level 1 exams after preparing with this book and find that parts of this book could better address your exam experience, we'd like to hear about it. Of course, you are under obligation to the LPI not to disclose specific exam details, but comments regarding the coverage of the LPI Objectives, level of detail, and relevance to the exam will be most helpful. We take your comments seriously and will do whatever we can to make this book as useful as it can be.
  • 15. Book: LPI Linux Certification in a Nutshell Section: Preface Acknowledgments I'd like to thank the LPI, its staff, its contributors, and its sponsors for creating a unique and valuable community-based certification program. The LPI mission and organization are in line with the open source community it serves, and the LPIC series of certificates are respected and credible achievements. For their general good advice as well as some specific information on PC hardware, my thanks go to Matt Welsh, Matthias Kalle Dalheimer, and Lar Kaufman, authors of Running Linux, Third Edition. Likewise, Linux in a Nutshell, Third Edition, by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, and Stephen Figgins, is invaluable for reference information like bash programming details. I'm also indebted to the many volunteer authors and editors contributing to the Linux Documentation Project. A lot of important feedback came from technical reviewers Kara Prichard and Richard Fifarek, and my hat's off to them for their detailed suggestions and corrections. Of course, this book wouldn't be nearly as readable or as useful without the dedicated support of my editor, Chuck Toporek. His guidance and encouragement kept me consistent, accurate, and motivated, and the book wouldn't have been the same without him. Thanks, Chuck! Thanks also to the others who helped with the completion of this book: Mary Brady, the production editor; Claire Cloutier, the production manager; and Ellie Volckhausen, the cover designer. Finally, I'd like to thank my lovely wife Monica, whose love, vision, and support made this project possible in the first place, and my boys Austin and Alexander, my constant source of inspiration.
  • 16. Book: LPI Linux Certification in a Nutshell Preface Objective certification of professionals is a time-honored tradition in many fields, including medicine and law. As small computer systems and networks proliferated over the last decade, Novell and Microsoft produced extremely popular certification products for their respective operating system and network technologies. These two programs are often cited as having popularized a certification market where products that had previously been highly specialized and relatively rare. These programs have become so popular that a huge training and preparation industry has formed to service a constant stream of new certification candidates. Certification programs, offered by vendors such as Sun and Hewlett-Packard, have existed in the Unix world for some time. However, since Solaris and HP-UX aren't commodity products, those programs don't draw the crowds that the PC platform does. Linux, however, is different. Linux is both a commodity operating system and is PC-based, and its popularity continues to grow at a rapid pace. As Linux deployment increases, so too does the demand for qualified and certified Linux system administrators. A number of programs -- the Linux Professional Institute, Sair Linux and GNU Certification, the Red Hat Certified Engineer (RHCE) program, and CompTIA's Linux+ -- have formed over the last few years to service this new market. Each of these programs seeks to provide objective measurements of a Linux administrator's skills, but they approach the problem in different ways. The RHCE program requires that candidates pass a hands-on practical skills test, solving problems and performing configuration tasks. Though more involved from an exam delivery point of view, this type of test is very thorough and difficult to beat using purely good study habits. The Sair program is provided by Sair, Inc., a for-profit company that is also a vendor for courseware and texts. The Linux+ exam, scheduled for deployment in 2001, is an entry-level certification, which brings us to the LPI.
  • 17. Book: LPI Linux Certification in a Nutshell Section: Part I: General Linux Exam 101 Chapter 1. Exam 101 Overview LPI Exam 101 is one of two exams required for the LPIC Level 1 certification. In total, 14 major Topic areas are specified for Level 1; this exam tests your knowledge on 5 of them. Exam Topics are numbered using a level.topic notation (e.g., 1.2, 2.5). In the LPI's early stages of development, Topics were assigned to exams based on a different scheme than we see today. When the scheme changed, the Topics were redistributed to Exams 101 and 102, but the pairing of Topic numbers to exams was dropped. As a result, we have 1.x and 2.x Topics in both Level 1 exams. The Level 1 Topics are distributed between the two exams to create tests of similar length and difficulty without subject matter overlap. As a result, there's no requirement for or advantage to taking them in sequence. Each Topic contains a series of Objectives covering specific areas of expertise. Each of these Objectives is assigned a numeric weight, which acts as an indicator of the importance of the Objective. Weights run between 1 and 10, with higher numbers indicating more importance. An Objective carrying a weight of 1 can be considered relatively unimportant and isn't likely to be covered in much depth on the exam. Objectives with larger weights are sure to be covered on the exam, so you should study these Topics closely. The weights of the Objectives are provided at the beginning of each Topic section. The Topics for Exam 101 are listed in Table 1-1. Table 1-1. LPI Topics for Exam 101 Name Number of Objectives Description Chapter 3 7 This Topic covers many GNU and Unix commands used during day-to-day system administration activity. Objectives include command syntax, text filters, file management, pipes, redirects, process management, process execution priorities, and basic regular expressions. Chapter 4 8 Objectives for this Topic include the creation of partitions and filesystems, filesystem integrity, mounting, quotas, permissions, ownership, links, and file location tasks. Chapter 5 2 This short Topic covers system boot, lilo, syslog, runlevels, shutdown, and reboot. Chapter 6 4 This is an overview of Linux documentation sources, such as manpages, info pages, /usr/doc, Linux-related web sites, and the generation of local documentation. It also includes some discussion of user support. Chapter 7 5 This core system administration Topic includes user and group accounts, user environment issues, syslog, cron, at, and backup. As you can see from Table 1-1 the Topic numbers assigned by the LPI are not sequential. This is due
  • 18. to various modifications made by the LPI to its exam program as it developed. The Topic numbers serve only as reference and are not used on the exam. Exam 101 lasts a maximum of 90 minutes and contains approximately 60 questions. The exam is administered using a custom application on a PC in a private room with no notes or other reference material. About 75 percent of the exam is made up of multiple-choice single-answer questions. These questions have only one correct answer and are answered using radio buttons. Some of them present a scenario needing administrative action. Others seek appropriate commands for a particular task or for proof of understanding of a particular concept. About 10 percent of the exam questions are multiple-choice multiple-answer questions, which are answered using checkboxes. These questions can have multiple correct responses, each of which must be checked. This is probably the most difficult question style because the multiple answers increase the likelihood of mistakes. But they also are a good test of your knowledge of Unix commands, since an incorrect response on any one of the possible answers causes you to miss the entire question. The exam also has some fill-in-the-blank questions. These questions provide a one- line text area input box for you to fill in your answer. These questions check your knowledge of concepts such as important files and commands, plus common facts that you are expected to be aware of.
  • 19. Book: LPI Linux Certification in a Nutshell Part I: General Linux Exam 101 Part I covers the Topics and Objectives for the LPI's General Linux Certification for Exam 101 and includes the following sections: Exam 101 Overview Exam 101 Study Guide GNU and Unix Commands Devices, Linux Filesystems, and the Filesystem Hierarchy Standard Boot, Initialization, Shutdown, and Runlevels Documentation Administrative Tasks Exam 101 Review Questions and Exercises Exam 101 Practice Test Exam 101 Highlighter's Index
  • 20. Book: LPI Linux Certification in a Nutshell Section: Part I: General Linux Exam 101 Chapter 2. Exam 101 Study Guide Part I of this book contains a section for each of the five Topics found on LPI Exam 101. Each section details certain Objectives, which are described here and on the LPI web site, http://www.lpi.org/p- obj-101.html.
  • 21. Book: LPI Linux Certification in a Nutshell Section: Chapter 2. Exam 101 Study Guide 2.1 Exam Preparation LPI Exam 101 is thorough, but you should find it fairly straightforward if you have a solid foundation in Linux concepts. You won't come across questions that intend to trick you, and you're unlikely to find ambiguous questions. Exam 101 mainly tests your knowledge of facts, including commands and their common options, important file locations, configuration syntax, and common procedures. Your recollection of these details, regardless of your level of Linux administration experience, will directly influence your results. For clarity, the material in the following sections is presented in the same order as the LPI Topics and Objectives. However, you may choose to study the Topics in any order you wish. To assist you with your preparation, Table 2-1 through Table 2-5 list the Topics and Objectives found on Exam 101. Objectives within each Topic occupy rows of the corresponding table, including the Objective's number, description, and weight. The LPI assigns a weight for each Objective to indicate the relative importance of that Objective on the exam on a scale of 1 to 10. We recommend that you use the weights to prioritize what you decide to study in preparation for the exams. After you complete your study of each Objective, simply check it off here to measure and organize your progress. Table 2-1. GNU and Unix Commands (Topic 1.3) Objective Weight Description 1 4 Section 3.1 2 7 Section 3.2 3 2 Section 3.3 4 3 Section 3.4 5 5 Section 3.5 6 2 Section 3.6 7 3 Section 3.7 Table 2-2. Devices, Linux Filesystems, and the Filesystem Hierarchy Standard (Topic 2.4)
  • 22. Objective Weight Description 1 3 Section 4.1 2 5 Section 4.2 3 3 Section 4.3 4 1 Section 4.4 5 3 Section 4.5 6 2 Section 4.6 7 2 Section 4.7 8 2 Section 4.8 Table 2-3. Boot, Initialization, Shutdown, and Runlevels (Topic 2.6) Objective Weight Description 1 3 Section 5.1 2 3 Section 5.2 Table 2-4. Documentation (Topic 1.8) Objective Weight Description 1 5 Section 6.1 2 2 Section 6.2 3 1 Section 6.3 4 1 Section 6.4 Table 2-5. Administrative Tasks (Topic 2.11) Objective Weight Description 1 7 Section 7.1 2 4 Section 7.2 3 3 Section 7.3 4 4 Section 7.4 5 3 Section 7.5
  • 23. Book: LPI Linux Certification in a Nutshell Section: Part I: General Linux Exam 101 Chapter 3. GNU and Unix Commands (Topic 1.3) This Topic covers the ever-important aspect of working interactively with Linux command-line utilities. While it's true that GUI tools are already available to manage just about everything on a Linux system, a firm understanding of basic use of command-line utilities is essential. The family of commands that are part of Linux and Unix systems has a long history. Individuals or groups that needed specific tools contributed many of the commands in the early days of Unix development. Those that were popular became part of the system and were accepted as default tools under the Unix umbrella. Today, Linux systems carry new, often more powerful GNU versions of these historical commands. This section covers LPI Topic 1.3, GNU and Unix Commands. Even the Topic name implies the confusion that may exist regarding the origin of the commands we're using on GNU/Linux systems. Remember that for software to be freely distributed as part of your Linux distribution, it cannot be proprietary and must come with some form of redistribution ability in its licensing terms. This LPI Topic has seven Objectives: Objective 1: Work Effectively on the Unix Command Line This Objective covers the essentials of working at the command line in a shell, including environment variables, using the command history and editing facilities, invoking commands, command substitution, and recursively executing commands. Weight: 4. Objective 2: Process Text Streams Using Text-Processing Filters There exists a diverse "toolbox" of interesting and powerful utilities from the GNU textutils package, which can be used to manipulate text in various ways. This Objective covers those utilities and how to use them. Weight: 7. Objective 3: Perform Basic File Management If you're used to an entirely GUI computing environment, performing basic file management manually from the command line may be awkward at first. You'll find, however, that after mastering a few simple commands you will achieve much finer control over file management chores. This Objective covers simple and recursive file management, including the use of wildcards (regular expressions). Weight: 2. Objective 4: Use Unix Streams, Pipes, and Redirects Among the most powerful concepts in the Linux and Unix worlds is the idea of creating text streams. This powerful tool offers you the ability to succinctly string various commands (such as those described in Objective 2) together into customized editing chains, which modify text in a serial fashion. Objective 4 includes redirection and the use of the tee command. Weight: 3. Objective 5: Create, Monitor, and Kill Processes Every running program on a Linux system is a process. Some processes are short-lived, like utility programs such as ls. Other processes, usually called daemons, are intended to run for extended periods or even constantly; these include processes such as web or database server
  • 24. software. Managing these processes is an important activity for a system administrator. This Objective covers foreground and background processing, process monitoring, signaling, and how to "kill" a process. Also covered are some of the commands used to manipulate running processes. Weight: 5. Objective 6: Modify Process Execution Priorities When you launch a process, you may wish to instruct the system to lower or raise its scheduling priority relative to the default. This action has the effect of giving more or less CPU time to your process. This is accomplished with the nice command, which modifies the default scheduling priority prior to running your command. This Objective covers these modifications. Weight: 2. Objective 7: Perform Searches of Text Files Making Use of Regular Expressions Many tools on your Linux system are capable of using regular expressions. At the most basic level, regular expressions are simply wildcard-matching mechanisms, such as you've probably used at the command line many times. While detailed use is beyond the scope of this book and the LPI exams, regular expressions are a powerful solution to a range of problems. This Objective covers basic regular expression usage with command-line tools such as sed and grep. Weight: 3. The tools and concepts discussed here represent important and fundamental aspects of working with Linux, and are essential for your success on Exam 101.
  • 25. Book: LPI Linux Certification in a Nutshell Section: Chapter 3. GNU and Unix Commands (Topic 1.3) 3.1 Objective 1: Work Effectively on the Unix Command Line Every computer system requires a human interface component. For Linux system administration, a text interface is typically used. The system presents the administrator with a prompt, which at its simplest is a single character such as $ or #. The prompt signifies that the system is ready to accept typed commands, which usually occupy one or more lines of text. This interface is generically called the command line. It is the job of a program called a shell to provide the command prompt and to interpret commands. The shell provides an interface layer between the Linux kernel and the human user, which is how it gets its name. The original shell for Unix systems was written by Steve Bourne and was called simply sh. The default Linux shell is bash, the Bourne-Again Shell, which is a GNU variant of sh. The popular tcsh shell, a variant of the original csh (or C shell), is also provided. The bash shell is the subject of an entire LPI Topic, covered in Chapter 17. At this point, we are primarily concerned with our interaction with bash and the effective use of commands. 3.1.1 The Interactive Shell The shell is a powerful programming environment, capable of automating nearly anything you can imagine on your Linux system. The shell is also your interactive interface to your system. When you first start a shell, it does some automated housekeeping to get ready for your use, and then presents a command prompt. The command prompt tells you that the shell is ready to accept commands from its standard input device, which is usually the keyboard. Shells can run standalone, as on a physical terminal, or within a window in a GUI environment. Whichever the case, their use is the same. 3.1.1.1 Shell variable basics During execution, bash maintains a set of shell variables that contain information important to the execution of bash. Most of these variables are set when bash starts, but they can be set manually at any time. The first shell variable of interest in this Topic is called PS1 (which simply stands for Prompt String 1). This special variable holds the contents of the command prompt that are displayed when bash is ready to accept commands (there is also a PS2 variable, used when bash needs multiple-line input to complete a command). You can easily display the contents of PS1, or any other shell variable, by using the echo command with the variable name preceded by the $ symbol: $ echo $PS1 $ The $ output tells us that PS1 contains the two characters and $. The backslash character tells the shell not to interpret the dollar symbol in any special way (that is, as a metacharacter, described later in this section). A simple dollar sign such as this was the default prompt for sh, but bash offers options to make the prompt much more informative. On your system, the default prompt stored in PS1 is probably something like: [u@h W]$
  • 26. Each of the characters preceded by backslashes have a special meaning to bash, while those without backslashes are interpreted literally. In this example, u is replaced by the username, h is replaced by the system's hostname, W is replaced by the "bottom" portion of the current working directory, and $ is replaced by a $ character.[1] This yields a prompt of the form: [1] Unless you are root, in which case $ is replaced by #. [jdean@linuxpc jdean]$ How your prompt is formulated is really just a convenience and does not affect how the shell interprets your commands. However, adding information to the prompt, particularly regarding system, user, and directory location, can make life easier when hopping from system to system and logging in as multiple users (as yourself and root, for example). See the documentation on bash for more information on customizing prompts. Another shell variable that is extremely important during interactive use is PATH , which contains a list of all the directories that hold commands or other programs you are likely to execute. A default path is set up for you when bash starts. You may wish to modify the default to add other directories that hold programs you need to run. Every file in the Linux filesystem can be specified in terms of its location. The less program, for example, is located in the directory /usr/bin. Placing /usr/bin in your PATH enables you to execute less by simply typing less rather than the explicit /usr/bin/less. In order for bash to find and execute the command you enter at the prompt, the command must be either: A bash built-in command that is part of bash itself An executable program located in a directory listed in the PATH variable Explicitly defined The shell holds PATH and other variables for its own use. However, many of the shell's variables are needed during the execution of programs launched from the shell (including other shells). For these variables to be available, they must be exported, at which time they become environment variables. Environment variables are passed on to programs and other shells, and together they are said to form the environment in which the programs execute. PATH is always made into an environment variable.[2] Exporting a shell variable to turn it into an environment variable is done using the export command: [2] In the case of csh and tcsh, there are both shell and environment variables for PATH; the shell takes care of keeping them synchronized. $ export MYVAR When a variable is exported to the environment, it is passed into the environment of all child processes. That is, it will be available to all programs run by your shell. 3.1.1.2 Entering commands at the command prompt Commands issued to the shell on a Linux system generally consist of four components:
  • 27. A valid command (a shell built-in, a program or script found among directories listed in the PATH, or an explicitly defined program) Command options, usually preceded by a dash Arguments Line acceptance (i.e., pressing the Enter key), which we assume in the examples Each command has its own unique syntax, though most follow a fairly standard form. At minimum, a command is necessary: $ ls This simple command lists files in the current working directory. It requires neither options nor arguments. Generally, options are letters or words preceded by a single or double dash and are added after the command and separated from it by a space: $ ls -l The -l option modifies the behavior of the ls program by listing files in a longer, more detailed format. In most cases, single-dash options can be either combined or specified separately. To illustrate this, consider these two equivalent commands: $ ls -l -a $ ls -la By adding the -a option, ls does not hide files beginning with a dot (which it does by default). Adding that option by specifying -la yields the same result. Some commands offer alternative forms for the same option. In the preceding example, the -a option can be replaced with -- all: $ ls -l --all These double-dash full-word options are frequently found in programs from the GNU project. They cannot be combined as the single-dash options can. Both types of options can be freely intermixed. Although the longer GNU-style options require more typing, they are easier to remember and easier to read in scripts than the single-letter options. Adding an argument further refines the command's behavior: $ ls -l *.c Now the command will give a detailed listing only of C program source files (those with the .c extension), if they exist, in the current working directory. In this example, if no .c files exist, no output will be given.[3] Sometimes, options and arguments can be mixed in order: [3] If a Unix or GNU command has nothing of significance to tell you, it most likely will remain silent. This brevity may take some users by surprise, particularly if they are used to systems that yield messages indicating something like "successful completion, but sorry, no results." $ ls --all *.c -l In this case, ls was able to determine that -l is an option and not another file descriptor. Some commands, such as tar and ps, don't require the dash preceding an option because at least one option is expected or required. Also, an option often instructs the command that the subsequent item on the command line is a specific argument. For example:
  • 28. $ tar cf mytarfile file1 file2 file3 $ tar -cf mytarfile file1 file2 file3 These equivalent commands use tar to create an archive file named mytarfile and put three files ( file1, file2, and file3) into it. In this case, the f option tells tar that archive filename mytarfile follows immediately after the option. Just as any natural language contains exceptions and variations, so does the syntax used for GNU and Unix commands. You should have no trouble learning the essential syntax for the commands you need to use often. The capabilities of the command set offered on Linux are extensive, making it highly unlikely that you'll memorize all of the command syntax you need. Most systems administrators are constantly learning about features they've never used in commands they use regularly. It is standard practice to regularly refer to man or info pages and other documentation on commands you're using, so feel free to explore and learn as you go. 3.1.1.3 Entering commands not in the PATH Occasionally, you will need to execute a command that is not in your path and not built into your shell. If this need arises often, it may be best to simply add the directory that contains the command to your path. However, there's nothing wrong with explicitly specifying a command's location and name completely. For example, the ls command is located in /bin. This directory is most certainly in your PATH variable (if not, it should be!), which allows you to enter the ls command by itself on the command line: $ ls The shell will look for an executable file named ls in each successive directory listed in your PATH variable and will execute the first one it finds. Specifying the fully qualified filename for the command eliminates the directory search and yields identical results: $ /bin/ls Any executable file on your system may be started in this way. However, it is important to remember that some programs may have requirements during execution about what is listed in your PATH. A program can be launched normally but may fail if it is unable to find a required resource if the PATH is incomplete. 3.1.1.4 Entering multiple-line commands interactively In addition to its interactive capabilities, the shell also has a complete programming language of its own. Many programming features can be very handy at the interactive command line as well. Looping constructs, including for, until, and while are often used this way. When you begin a command such as these, which normally spans multiple lines, bash prompts you for the subsequent lines until a valid command has been completed. The prompt you receive in this case is stored in shell variable PS2, which by default is >. For example, if you wanted to repetitively execute a series of commands each time with a different argument from a known series, you could enter the following: $ ...series of commands on arg1... command output $ ...series of commands on arg2... command output $ ...series of commands on arg2... command output Rather than entering each command manually, you can interactively use bash's for loop construct to
  • 29. do the work for you. Note that indented style, such as what you might use in traditional programming, isn't necessary when working interactively with the shell: $ for var in arg1 arg2 arg3 > do > echo $var > ...series of commands... > done arg1 command output arg2 command output arg3 command output Mixing the command-line world with the shell-scripting world in this way can make certain tasks surprisingly efficient. 3.1.1.5 Entering command sequences There may be times when it is convenient to place multiple commands on a single line. Normally, bash assumes you have reached the end of a command (or the end of the first line of a multiple-line command) when you press Return. To add more than one command to a single line, the commands can be separated and entered sequentially with the command separator , a semicolon. Using this syntax, the following commands: $ ls $ ps are, in essence, identical to and will yield the same result as the following single-line command that employs the command separator: $ ls; ps On the Exam Command syntax and the use of the command line is very important. Pay special attention to the use of options and arguments and how they are differentiated. Also be aware that some commands expect options to be preceded by a dash while other commands do not. 3.1.2 Command History and Editing If you consider interaction with the shell as a kind of conversation, it's a natural extension to refer back to things "mentioned" previously. You may type a long and complex command that you want to repeat, or perhaps you need to execute a command multiple times with slight variation. If you work interactively with the original Bourne shell, maintaining such a "conversation" can be a bit difficult. Each repetitive command must be entered explicitly, each mistake must be retyped, and if your commands scroll off the top of your screen, you have to recall them from memory. Modern shells such as bash and tcsh include a significant feature set called command history, expansion, and editing. Using these capabilities, referring back to previous commands is painless, and your interactive shell session becomes much simpler and more effective.
  • 30. The first part of this feature set is command history. When bash is run interactively, it provides access to a list of commands previously typed. The commands are stored in the history list prior to any interpretation by the shell. That is, they are stored before wildcards are expanded or command substitutions are made. The history list is controlled by the HISTSIZE shell variable. By default, HISTSIZE is set to 500 lines, but you can control that number by simply adjusting HISTSIZE's value. In addition to commands entered in your current bash session, commands from previous bash sessions are stored by default in a file called ~/.bash_history (or the file named in shell variable HISTFILE).[4] To view your command history, use the bash built-in history command. A line number will precede each command. This line number may be used in subsequent history expansion. History expansion uses either a line number from the history or a portion of a previous command to reexecute that command.[5] Table 3-1 lists the basic history expansion designators. In each case, using the designator as a command causes a command from the history to be executed again. [4] If you use multiple shells in a windowed environment (as just about everyone does), the last shell to exit will write its history to ~/.bash_history. For this reason you may wish to use one shell invocation for most of your work. [5] History expansion also allows a fair degree of command editing using syntax you'll find in the bash documentation. Table 3-1. Command History Expansion Designators Designator Description !! Often called bang-bang,[6] this command refers to the most recent command. !n Refer to command n from the history. You'll use the history command to display these numbers. !-n Refer to the current command minus n from the history. ! string Refer to the most recent command starting with string. !? string Refer to the most recent command containing string. ^ string1^string2 Quick substitution. Repeat the last command, replacing the first occurrence of string1 with string2. [6] The exclamation point is often called bang on Linux and Unix systems. While using history substitution can be useful for executing repetitive commands, command history editing is much more interactive. To envision the concept of command history editing, think of your entire bash history (including that obtained from your ~/.bash_history file) as the contents of an editor's buffer. In this scenario, the current command prompt is the last line in an editing buffer, and all of the previous commands in your history lie above it. All of the typical editing features are available with command history editing, including movement within the "buffer," searching, cutting, pasting, and so on. Once you're used to using the command history in an editing style, everything you've done on the command line becomes available as retrievable, reusable text for subsequent commands. The more familiar you become with this concept, the more useful it can be. By default, bash uses key bindings like those found in the Emacs editor for command history editing.[7] If you're familiar with Emacs, moving around in the command history will be familiar and very similar to working in an Emacs buffer. For example, the key command Ctrl-p (depicted as C-p) will move up one line in your command history, displaying your previous command and placing the cursor at the end of it. This same function is also bound to the up arrow key. The opposite function is bound to C-n (and the down arrow). Together, these two key bindings allow you to examine your history line by line. You may reexecute any of the commands shown simply by pressing Return when it is displayed. For the purposes of Exam 101, you'll need to be familiar with this editing capability,
  • 31. but detailed knowledge is not required. Table 3-2 lists some of the common Emacs key bindings you may find useful in bash. Note that C- indicates the Ctrl key, while M- indicates the Meta key, which is usually Alt on PC keyboards.[8] [7] An editing style similar to the vi editor is also available. [8] In unusual circumstances, such as on a terminal, using the meta key means pressing the Escape (Esc) key, releasing it, and then pressing the defined key. The Esc key is not a modifier, but serves to modify meta keys when an Alt-style key is unavailable. Table 3-2. Basic Command History Editing Emacs Key Bindings Key Description C-p Previous line (also up arrow) C-n Next line (also down arrow) C-b Back one character (also left arrow) C-f Forward one character (also right arrow) C-a Beginning of line C-e End of line C-l Clear the screen, leaving the current line at the top of the screen M-< Top of history M-> Bottom of history C-d Delete character from right C-k Delete (kill) text from cursor to end of line C-y Paste (yank) text previously cut (killed) M-d Delete (kill) word C-rtext Reverse search for text C-stext Forward search for text 3.1.2.1 Command substitution bash offers a handy ability to do command substitution. This feature allows you to replace the result of a command with a script. For example, wherever $( command) is found, its output will be substituted. This output could be assigned to a variable, as in the number of lines in the .bashrc file: $ RCSIZE=$(wc -l ~/.bashrc) Another form of command substitution is `command`. The result is the same, except that the backquote syntax has some special rules regarding metacharacters that the $(command) syntax avoids. 3.1.2.2 Applying commands recursively through a directory tree There are many times when it is necessary to execute commands recursively. That is, you may need to repeat a command throughout all the branches of a directory tree. Recursive execution is very useful but also can be dangerous. It gives a single interactive command the power to operate over a much broader range of your system than your current directory, and the appropriate caution is necessary. Think twice before using these capabilities, particularly when operating as the superuser.
  • 32. Some of the GNU commands on Linux systems have built-in recursive capabilities as an option. For example, chmod modifies permissions on files in the current directory: $ chmod g+w *.c In this example, all files with the .c extension in the current directory are modified with the group- write permission. However, there may be a number of directories and files in hierarchies that require this change. chmod contains the -R option (note the uppercase option letter; you may also use -- recursive), which instructs the command to operate not only on files and directories specified on the command line, but also on all files and directories contained under the specified directories. For example, this command gives the group-write permission to all files in a source-code tree named src: $ chmod -R g+w src Provided you have the correct privileges, this command will descend into each subdirectory in the src directory and add the requested permission to each file and directory it finds. Other example commands with this ability include cp (copy), ls (list files), and rm (remove files). A more general approach to recursive execution through a directory is available by using the find command. This is an extremely powerful command because it can tell you a lot about your system's file structure. find is inherently recursive and is intended to descend through directories looking for files with certain attributes or executing commands. At its simplest, find displays an entire directory hierarchy when you simply enter the command with a target directory: $ find src ...files and directories are listed recursively... To get more specific, add the -name option to search the same directories for C files: $ find src -name "*.c" ....c files are listed recursively[9]... [9] This can be done recursively with the ls command as well. find can also execute commands against its results with the -exec option, which can execute any command against each successive element listed by find. During execution, a special variable {} is replaced by these find results. The command entered after the -exec option must be terminated by a semicolon; any metacharacters used -- including the semicolon -- must be either quoted or escaped. To take the previous example a little further, rather than execute the chmod recursively against all files in the src directory, find can execute it against the C files only, like this: $ find src -name "*.c" -exec chmod g+w {} ; The find command is capable of much more than this simple example and can locate files with particular attributes such as dates, protections, file types, access times, and others. While the syntax can be confusing, the results are worth some study of find.
  • 33. Book: LPI Linux Certification in a Nutshell Section: Chapter 3. GNU and Unix Commands (Topic 1.3) 3.2 Objective 2: Process Text Streams Using Text-Processing Filters Many of the commands on Linux systems are intended to be used as filters, which modify text in helpful ways. Text fed into the command's standard input or read from files is modified in some useful way and sent to standard output or to a new file. Multiple commands can be combined to produce text streams, which are modified at each step in a pipeline formation. This section describes basic use and syntax for the filtering commands important for Exam 101. Refer to a Linux command reference for full details on each command and the many other available commands. cut Syntax cut options [files] Description Cut out (that is, print) selected columns or fields from one or more files. The source file is not changed. This is useful if you need quick access to a vertical slice of a file. By default, the slices are delimited by a tab. Frequently used options -b list Print bytes in list positions. -c list Print characters in list columns. -d delim Set field delimiter for -f. -f list Print list fields. Examples Show usernames (in the first colon-delimited field) from /etc/passwd: $ cut -d: -f1 /etc/passwd
  • 34. Show first column of /etc/passwd: $ cut -c 1 /etc/passwd expand Syntax expand [options] files Description Convert tabs to spaces. Sometimes the use of tab characters can make output that is attractive on one output device look bad on another. This command eliminates tabs and replaces them with the equivalent number of spaces. By default, tabs are assumed to be eight spaces apart. Frequently used options -t tabs Specify tab stops, in place of default 8. -i Initial; convert only at start of lines. fmt Syntax fmt [options] [files] Description Format text to a specified width by filling lines and removing newline characters. Multiple files from the command line are concatenated. Frequently used options -u Use uniform spacing: one space between words and two spaces between sentences. -w width Set line width to width. The default is 75 characters.
  • 35. head Syntax head [options] [files] Description Print the first few lines of one or more files (the "head" of the file or files). When more than one file is specified, a header is printed at the beginning of each file, and each is listed in succession. Frequently used options -c n Print the first n bytes, or if n is followed by k or m, print the first n kilobytes or megabytes, respectively. -l n Print the first n lines. The default is 10. join Syntax join [options] file1 file2 Description Print a line for each pair of input lines, one each from file1 and file2, that have identical join fields. This function could be thought of as a very simple database table join, where the two files share a common index just as two tables in a database would. Frequently used options -j1 field Join on field of file1. -j2 field Join on field of file2. -j field Join on field of both file1 and file2.
  • 36. Example Suppose file1 contains the following: 1 one 2 two 3 three and file2 contains: 1 11 2 22 3 33 Issuing the command: $ join -j 1 file1 file2 yields the following output: 1 one 11 2 two 22 3 three 33 nl Syntax nl [options] [files] Description Number the lines of files, which are concatenated in the output. This command is used for numbering lines in the body of text, including special header and footer options normally excluded from the line numbering. The numbering is done for each logical page, which is defined as having a header, a body, and a footer. These are delimited by the special strings :::, ::, and :, respectively. Frequently used options -b style Set body numbering style to style, t by default. -f style Set footer number style to style, n by default. -h style Set header numbering style to style, n by default. Styles can be in these forms:
  • 37. A Number all lines. t Only number non-empty lines. n Do not number lines. pREGEXP Only number lines that contain a match for regular expression REGEXP. Example Suppose file file1 contains the following text: ::: header :: line1 line2 line3 : footer ::: header :: line1 line2 line3 : footer If the following command is given: $ nl -h a file1 the output would yield numbered headers and body lines but no numbering on footer lines. Each new header represents the beginning of a new logical page and thus a restart of the numbering sequence: 1 header 2 line1 3 line2 4 line3 footer 1 header 2 line1 3 line2
  • 38. 4 line3 footer od Syntax od [options] [files] Description Dump files in octal and other formats. This program prints a listing of a file's contents in a variety of formats. It is often used to examine the byte codes of binary files but can be used on any file or input stream. Each line of output consists of an octal byte offset from the start of the file followed by a series of tokens indicating the contents of the file. Depending on the options specified, these tokens can be ASCII, decimal, hexadecimal, or octal representations of the contents. Frequently used options -t type Specify the type of output. Typical types include: A Named character c ASCII character or backslash escape O Octal (the default) x Hexadecimal Example If file1 contains: a1n A1n where n stands for the newline character. The od command specifying named characters yields the following output: $ od -t a file1 00000000 a 1 nl A 1 nl 00000006
  • 39. A slight nuance is the ASCII character mode. This od command specifying named characters yields the following output with backslash-escaped characters rather than named characters: $ od -t c file1 00000000 a 1 n A 1 n 00000006 With numeric output formats, you can instruct od on how many bytes to use in interpreting each number in the data. To do this, follow the type specification by a decimal integer. This od command specifying single-byte hex results yields the following output: $ od -t x1 file1 00000000 61 31 0a 41 31 0a 00000006 Doing the same thing in octal notation yields: $ od -t o1 file1 00000000 141 061 012 101 061 012 00000006 If you examine an ASCII chart with hex and octal representations, you'll see that these results match those tables. paste Syntax paste [options] files Description Paste together corresponding lines of one or more files into vertical columns. Frequently used options -d'n' Separate columns with character n in place of the default tab. -s Merge lines from one file into a single line. When multiple files are specified, their contents are placed on individual lines of output, one per file. For the following three examples, file1 contains: 1 2 3 and file2 contains:
  • 40. A B C Example 1 A simple paste creates columns from each file in standard output: $ paste file1 file2 1 A 2 B 3 C Example 2 The column separator option yields columns separated by the specified character: $ paste -d'@' file1 file2 1@A 2@B 3@C Example 3 The single-line option (-s) yields a line for each file: $ paste -s file1 file2 1 2 3 A B C pr Syntax pr [options] [file] Description Convert a text file into a paginated, columnar version, with headers and page fills. This command is convenient for yielding nice output, such as for a line printer from raw uninteresting text files. The header will consist of the date and time, the filename, and a page number. Frequently used options -d Double space. -h header Use header in place of the filename in the header.
  • 41. -l lines Set page length to lines. The default is 66. -o width Set the left margin to width. split Syntax split [option] [infile] [outfile] Description Split infile into a specified number of line groups, with output going into a succession of files, outfileaa, outfileab, and so on (the default is xaa, xab, etc.). The infile remains unchanged. This command is handy if you have a very long text file that needs to be reduced to a succession of smaller files. This was often done to email large files in smaller chunks, because it was at one time considered bad practice to send single large email messages. Frequently used option -n Split the infile into n-line segments. The default is 1000. Example Suppose file1 contains: 1 one 2 two 3 three 4 four 5 five 6 six Then the command: $ split -2 file1 splitout_ yields as output three new files, splitout_aa, splitout_ab, and splitout_ac. The file splitout_aa contains: 1 one 2 two splitout_ab contains: 3 three
  • 42. 4 four and splitout_ac contains: 5 five 6 six tac Syntax tac [file] Description This command is named as an opposite for the cat command, which simply prints text files to standard output. In this case, tac prints the text files to standard output with lines in reverse order. Example Suppose file1 contains: 1 one 2 two 3 three Then the command: $ tac file1 yields as output: 3 three 2 two 1 one tail Syntax tail [options] [files] Description Print the last few lines of one or more files (the "tail" of the file or files). When more than one file is specified, a header is printed at the beginning of each file, and each is listed in succession. Frequently used options
  • 43. -c n This option prints the last n bytes, or if n is followed by k or m, the last n kilobytes or megabytes, respectively. -f Follow the output dynamically as new lines are added to the bottom of a file. -n m Prints the last m lines. The default is 10. -f Continuously display a file as it is actively written by another process. This is useful for watching log files as the system runs. tr Syntax tr [options] [[string1 [string2]] Description Translate characters from string1 to the corresponding characters in string2. tr does not have file arguments and therefore must use standard input and output. If string1 and string2 specify ranges (a-z or A-Z), they should represent the same number of characters. Frequently used options -d Delete characters in string1 from the output. -s Squeeze out repeated output characters in string1. Example 1 To change all lowercase characters in file1 to uppercase, use either of these commands: $ cat file1 | tr a-z A-Z or: $ tr a-z A-Z < file1 Example 2
  • 44. To suppress repeated "a" characters from file1: $ cat file1 | tr -s a Example 3 To remove all "a," "b," and "c" characters from file1: $ cat file1 | tr -d abc wc Syntax wc [options] [files] Description Print counts of characters, words, and lines for files. When multiple files are listed, statistics for each file output on a separate line with a cumulative total output last. Frequently used options -c Print the character count only. -l Print the line count only. -w Print the word count only. Example 1 Show all counts and totals for file1, file2, and file3: $ wc file[123] Example 2 Count the number of lines in file1: $ wc -l file1 xargs
  • 45. Syntax xargs [options] [command] [initial-arguments] Description Execute command followed by its optional initial-arguments and append additional arguments found on standard input. Typically, the additional arguments are filenames in quantities too large for a single command line. xargs runs command multiple times to exhaust all arguments on standard input. Frequently used options -n maxargs Limit the number of additional arguments to maxargs for each invocation of command. -p Interactive mode. Prompt the user for each execution of command. Example Use grep to search a long list of files, one by one, for the word "linux": $ find / -type f | xargs -n 1 grep linux find searches for normal files (-type f ) starting at the root directory. xargs executes grep once for each of them due to the -n 1 option. 3.2.1 The Stream Editor, sed Another filtering program found on nearly every Unix system is sed, the stream editor. It is called a stream editor because it is intended as a filter, with text usually flowing from standard input, through the utility, to standard output. Unlike the previously listed commands, sed is a programmable utility with a range of capabilities. During processing, sed interprets instructions from a sed script, processing the text according to those instructions. The script may be a single command or a longer list of commands. It is important to understand sed and its use for Exam 101, although detailed knowledge is not required or offered in this brief introduction. The sed utility is usually used either to automate repetitive editing tasks or to process text in pipes of Unix commands (see Objective 4). The scripts that sed executes can be single commands or more complex lists of editing instructions. It is invoked using one of the following methods. sed Syntax sed [options] 'command1' [files] sed [options] -e 'command1' [-e 'command2'...] [files]
  • 46. sed [options] -f script [files] Description The first form invokes sed with a one-line command1. The second form invokes sed with two (or more) commands. Note that in this case the -e parameter is required for all commands specified. The commands are specified in quotes to prevent the shell from interpreting and expanding them. The last form instructs sed to take editing commands from file script (which does not need to be executable). In all cases, if files are not specified, input is taken from standard input. If multiple files are specified, the edited output of each successive file is concatenated. Frequently used options -e cmd The next argument is a command. This is not needed for single commands but is required for all commands when multiple commands are specified. -f file The next argument is a script. -g Treat all substitutions as global. The sed utility operates on text through the use of addresses and editing commands. The address is used to locate lines of text to be operated upon, and editing commands modify text. During operation, each line (that is, text separated by newlinecharacters) of input to sed is processed individually and without regard to adjacent lines. If multiple editing commands are to be used (through the use of a script file or multiple -e options), they are all applied in order to each line before moving on to the next line. Input to sed can come from standard input or from files. When input is received from standard input, the original versions of the input text are lost. However, when input comes from files, the files themselves are not changed by sed. The output of sed represents a modified version of the contents of the files but does not affect them. Addressing Addresses in sed locate lines of text to which commands will be applied. The addresses can be: A line number (note that sed counts lines continuously across multiple input files). A line number with an interval. The form is n~s, where n is the starting line number and s is the step, or interval, to apply. For example, to match every odd line in the input, the address specification would be 1~2 (start at line 1 and match every two lines thereafter). This feature is a GNU extension to sed. The symbol $, indicating the last line of the last input file. A regular expression delimited by forward slashes (/regex/ ). See Objective 7 for more information on using regular expressions.
  • 47. Zero, one, or two such addresses can be used with a sed command. If no addresses are given, commands are applied to all input lines by default. If a single address is given, commands are applied only to a line or lines matching the address. If two comma-separated addresses are given, an inclusive range is implied. Finally, any address may be followed by the ! character, and commands are applied to lines that do not match the address. Commands The sed command immediately follows the address specification if present. Commands generally consist of a single letter or symbol, unless they have arguments. Following are some basic sed editing commands to get you started. d Delete lines. s Make substitutions.This is a very popular sed command. The syntax is: s/pattern/replacement/[flags] The following flags can be specified for the s command: g Replace all instances of pattern, not just the first. n Replace n th instance of pattern; the default is 1. p Print the line if a successful substitution is done. Generally used with the -n command-line option. w file Print the line to file if a successful substitution is done. y Translate characters. This command works in a fashion similar to the tr command, described earlier. Example 1 Delete lines 3 through 5 of file1: $ sed '3,5d' file1 Example 2 Delete lines of file1 that contain a # at the beginning of the line: $ sed '/^#/d' file1
  • 48. Example 3 Translate characters: y/abc/xyz/ Every instance of a is translated to x, b to y, and c to z. Example 4 Write the @ symbol for all empty lines in file1 (that is, lines with only a newline character but nothing more): $ sed 's/^$/@/' file1 Example 5 Remove all double quotation marks from all lines in file1: $ sed 's/"//g' file1 Example 6 Using sed commands from external file sedcmds, replace the third and fourth double quotation marks with ( and ) on lines 1 through 10 in file1. Make no changes from line 11 to the end of the file. Script file sedcmds contains: 1,10{ s/"/(/3 s/"/)/4 } The command is executed using the -f option: $ sed -f sedcmds file1 This example employs the positional flag for the s (substitute) command. The first of the two commands substitutes ( for the third double-quote character. The next command substitutes ) for the fourth double-quote character. Note, however, that the position count is interpreted independently for each subsequent command in the script. This is important because each command operates on the results of the commands preceding it. In this example, since the third double quote has been replaced with ( , it is no longer counted as a double quote by the second command. Thus, the second command will operate on the fifth double quote character in the original file1. If the input line starts out with: """""" after the first command, which operates on the third double quote, the result is: ""(""" At this point, the numbering of the double-quote characters has changed, and the fourth double quote in the line is now the fifth character. Thus, after the second command executes, the output is: ""(")"
  • 49. Discovering Diverse Content Through Random Scribd Documents
  • 50. was intended as a text or handbook for the Ráwí or professional story-teller, who would declaim the recitative in quasi-conversational tones, would intone the Saj’a and would chant the metrical portions to the twanging of the Rabábah or one-stringed viol. The Reviewer declares that the original has many such passages; but why does he not tell the reader that almost the whole Koran, and indeed all classical Arab prose, is composed in such “jingle”? “Doubtfully pleasing in the Arabic,” it may “sound the reverse of melodious in our own tongue” (p. 282); yet no one finds fault with it in the older English authors (Terminal Essay, p. 256), and all praised the free use of it in Eastwick’s “Gulistán.” Torrens, Lane and Payne deliberately rejected it, each for his own and several reason; Torrens because he never dreamt of the application; Lane, because his scanty knowledge of English stood in his way; and Payne because he aimed at a severely classical style, which could only lose grace, vigour and harmony by such exotic decoration. In these matters every writer has an undoubted right to carry out his own view, remembering the while that it is impossible to please all tastes. I imitated the Saj’a, because I held it to be an essential part of the work, and of my fifty reviewers none save the Edinburgh considered the reproduction of the original manner aught save a success. I care only to satisfy those whose judgment is satisfactory: “the abuse and contempt of ignorant writers hurts me very little” as Darwin says (iii. 88), and we all hold with Don Quixote that, es mejor ser loado de los pocos sabios, que burlado de los muchos necios. “This amusement (of reproducing the Saj’a) maybe carried to any length (how?), and we do not see why Captain Burton neglects the metre of the poetry, or divides his translation into sentences by stops, or permits any break in the continuity of the narrative, since none such exists in the Arabic” (p. 182). My reply is that I neglect the original metres first and chiefly because I do not care to “caper in fetters,” as said Drummond of Hawthornden; and, secondly, because many of them are unfamiliar and consequently unpleasant to English ears. The exceptions are mostly two, the Rajaz (Anapæsts and Iambs, Terminal Essay, x. 294), and the Tawíl or long measure
  • 51. (ibid. pp. 282, 296), which Mr. Lyall (Translations of Ancient Arab. Poetry, p. xlix.) compares with “Abt Vogler,”
  • 52. And there! ye have heard and seen: consider and bow the head. This metre greatly outnumbers all others in The Nights; but its lilting measure by no means suits every theme and in English it is apt to wax monotonous. “The following example of a literal rendering which Mr. Payne adduces (vol. ix. 381: comp. my vol. v. 66) in order to show the difficulty of turning the phraseology of the original into good English, should have served Captain Burton as a model, and we are surprised he has not adopted so charmingly cumbrous a style” (p. 102). I shall quote the whole passage in question and shall show that by the most unimportant changes, omissions and transpositions, without losing a word, the whole becomes excellent English, and falls far behind the Reviewer’s style in the contention for “cumbrousness”:— “When morrowed the morning he bedabbled his feet with the water they twain had expressed from the herb and, going-down to the sea, went thereupon walking days and nights, he wondering the while at the horrors of the ocean and the marvels and rarities thereof. And he ceased not faring over the face of the waters till he arrived at an island as indeed it were Paradise. So Bulukiya went up thereto and fell to wondering thereanent and at the beauties thereof; and he found it a great island whose dust was saffron and its gravel were cornelian and precious stones: its edges were gelsomine and the growth was the goodliest of the trees and the brightest of the scented herbs and the sweetest of them. Its rivulets were a-flowing; its brushwood was of the Comorin aloe and the Sumatran lign-aloes; its reeds were sugar-canes and round about it bloomed rose and narcissus and amaranth and gilliflower and chamomile and lily and violet, all therein being of several kinds and different tints. The birds warbled upon those trees and the whole island was fair of attributes and spacious of sides and abundant of good things, comprising in fine all of beauty and loveliness,” etc. (Payne, vol. ix. p. 381). The Reviewer cites in his list, but evidently has not read, the “Tales from the Arabic,” etc., printed as a sequel to The Nights, or he would have known that Mr. Payne, for the second part of his work, deliberately adopted a style literal as that above-quoted because it was the liveliest copy of the original. We now come to the crucial matter of my version, the annotative concerning which this “decent gentleman,” as we suppose this critic would entitle himself (p. 185) finds a fair channel of discharge for
  • 53. vituperative rhetoric. But before entering upon this subject I must be allowed to repeat a twice-told tale and once more to give the raison d’être of my long labour. When a friend asked me point-blank why I was bringing out my translation so soon after another and a most scholarly version, my reply was as follows:—“Sundry students of Orientalism assure me that they are anxious to have the work in its crudest and most realistic form. I have received letters saying, Let us know (you who can) what the Arab of The Nights was: if good and high-minded let us see him: if witty and humorous let us hear him: if coarse and uncultivated, rude, childish and indecent, still let us have him to the very letter. We want for once the genuine man. We would have a mediæval Arab telling the tales and traditions with the lays and legends of his own land in his own way, and showing the world what he has remained and how he has survived to this day, while we Westerns have progressed in culture and refinement. Above all things give us the naïve and plain-spoken language of the original— such a contrast with the English of our times—and show us, by the side of these enfantillages, the accumulated wit and wisdom, life- knowledge and experience of an old-world race. We want also the technique of the Recueil, its division into nights, its monorhyme, in fact everything that gives it cachet and character.” Now I could satisfy the longing, which is legitimate enough, only by annotation, by a running commentary, as it were, enabling the student to read between the lines and to understand hints and innuendoes that would otherwise have passed by wholly unheeded. I determined that subscribers should find in my book what does not occur in any other, making it a repertory of Eastern knowledge in its esoteric phase, by no means intended for the many-headed but solely for the few who are not too wise to learn or so ignorant as to ignore their own ignorance. I regretted to display the gross and bestial vices of the original, in the rare places where obscenity becomes rampant, but not the less I held it my duty to translate the text word for word, instead of garbling it and mangling it by perversion and castration. My rendering (I promised) would be something novel, wholly different from all other versions, and it would leave very little for any future interpreter.[454]
  • 54. And I resolved that, in case of the spiteful philanthropy and the rabid pornophobic suggestion of certain ornaments of the Home-Press being acted upon, to appear in Court with my version of The Nights in one hand and bearing in the other the Bible (especially the Old Testament, a free translation from an ancient Oriental work) and Shakespeare, with Petronius Arbiter and Rabelais by way of support and reserve. The two former are printed by millions; they find their way into the hands of children, and they are the twin columns which support the scanty edifice of our universal home-reading. The Arbiter is sotadical as Abú Nowás and the Curé of Meudon is surpassing in what appears uncleanness to the eye of outsight not of insight. Yet both have been translated textually and literally by eminent Englishmen and gentlemen, and have been printed and published as an “extra series” by Mr. Bohn’s most respectable firm and sold by Messieurs Bell and Daldy. And if The Nights are to be bowdlerised for students, why not, I again ask, mutilate Plato and Juvenal, the Romances of the Middle Ages, Boccaccio and Petrarch and the Elizabethan dramatists one and all? What hypocrisy to blaterate about The Nights in presence of such triumphs of the Natural! How absurd to swallow such camels and to strain at my midge! But I had another object while making the notes a Repertory of Eastern knowledge in its esoteric form (Foreword p. xix). Having failed to free the Anthropological Society from the fetters of mauvaise honte and the mock-modesty which compels travellers and ethnological students to keep silence concerning one side of human nature (and that side the most interesting to mankind), I proposed to supply the want in these pages. The England of our day would fain bring up both sexes and keep all ages in profound ignorance of sexual and intersexual relations; and the consequences of that imbecility are peculiarly cruel and afflicting. How often do we hear women in Society lamenting that they have absolutely no knowledge of their own physiology; and at what heavy price must this fruit of the knowledge-tree be bought by the young first entering life. Shall we ever understand that ignorance is not innocence? What an
  • 55. absurdum is a veteran officer who has spent a quarter-century in the East without learning that all Moslem women are circumcised, and without a notion of how female circumcision is effected; without an idea of the difference between the Jewish and the Moslem rite as regards males; without an inkling of the Armenian process whereby the cutting is concealed, and without the slightest theoretical knowledge concerning the mental and spiritual effect of the operation. Where then is the shame of teaching what it is shameful not to have learnt? But the ultra-delicacy, the squeamishness of an age which is by no means purer or more virtuous than its ruder predecessors, has ended in trenching upon the ridiculous. Let us see what the modern English woman and her Anglo-American sister have become under the working of a mock-modesty which too often acts cloak to real dévergondage; and how Respectability unmakes what Nature made. She has feet but no “toes”; ankles but no “calves”; knees but no “thighs”; a stomach but no “belly” nor “bowels”; a heart but no “bladder” nor “groin”; a liver and no “kidneys”; hips and no “haunches”; a bust and nor “backside” nor “buttocks”: in fact, she is a monstrum, a figure fit only to frighten the crows. But the Edinburgh knows nothing of these things, and the “decent gentleman,” like the lady who doth protest overmuch, persistently fixes his eye upon a single side of the shield. “Probably no European has ever gathered such an appalling collection of degrading customs and statistics of vice as is contained in Captain Burton’s translation of the ‘Arabian Nights’” (p. 185). He finds in the case of Mr. Payne, like myself, “no adequate justification for flooding the world (!) with an ocean of filth” (ibid.) showing that he also can be (as said the past- master of catchwords, the primus verborum artifex) “an interested rhetorician inebriated with the exuberance of his own verbosity.” But audi alteram partem—my view of the question. I have no apology to make for the details offered to the students of Moslem usages and customs, who will find in them much to learn and more to suggest the necessity of learning. On no wise ashamed am I of lecturing upon these esoteric matters, the most important to humanity, at a
  • 56. time when their absence from the novel of modern society veils with a double gloom the night-side of human nature. Nay, I take pride to myself for so doing in the face of silly prejudice and miserable hypocrisy, and I venture to hold myself in the light of a public benefactor. In fact, I consider my labours as a legacy bequeathed to my countrymen at a most critical time when England the puissantest of Moslem powers is called upon, without adequate knowledge of the Moslem’s inner life, to administer Egypt as well as to rule India. And while Pharisee and Philister may be or may pretend to be “shocked” and “horrified” by my pages, the sound common sense of a public, which is slowly but surely emancipating itself from the prudish and prurient reticences and the immodest and immoral modesties of the early xixth century, will in good time do me, I am convinced, full and ample justice. In p. 184 the Reviewer sneers at me for writing “Roum” in lieu of Rum or Rúm; but what would the latter have suggested to the home-reader save a reference to the Jamaican drink? He also corrects me (vol. v. 248) in the matter of the late Mr. Emanuel Deutsch (p. 184), who excised “our Saviour” from the article on the Talmud reprinted amongst his literary remains. The Reviewer, or inspirer of the Review, let me own, knew more of Mr. Deutsch than I, a simple acquaintance, could know; but perhaps he does not know all, and if he did he probably would not publish his knowledge. The truth is that Mr. Deutsch was, during his younger years, a liberal, nay, a latitudinarian in religion, differing little from the so-styled “Christian Unitarian.” But when failing health drove him to Egypt and his hour drew nigh he became (and all honour to him!) the scrupulous and even fanatical Hebrew of the Hebrews; he consorted mainly with the followers and divines of his own faith, and it is said that he ordered himself when dying to be taken out of bed and placed upon the bare floor. The “Saviour” of the article was perhaps written in his earlier phase of religious thought, and it was excised as the end drew in sight. “Captain Burton’s experience in the East seems to have obliterated any (all?) sentiments of chivalry, for he is never weary of recording
  • 57. disparaging estimates of women, and apparently delights in discovering evidence of ‘feminine devilry’” (p. 184). This argumentum ad feminam is sharpish practice, much after the manner of the Christian “Fathers of the Church” who, themselves vehemently doubting the existence of souls non-masculine, falsely and foolishly ascribed the theory and its consequences to Mohammed and the Moslems. And here the Persian proverb holds good “Harf-i-kufr kufr níst”—to speak of blasphemy is not blasphemous. Curious readers will consult the article “Woman” in my Terminal Essay (x. 192), which alone refutes this silly scandal. I never pretended to understand woman, and, as Balzac says, no wonder man fails when He who created her was by no means successful. But in The Nights we meet principally Egyptian maids, matrons and widows, of whose “devilry” I cannot speak too highly, and in this matter even the pudibund Lane is as free-spoken as myself. Like the natives of warm, damp and malarious lowlands and river-valleys adjacent to rugged and healthy uplands, such as Mazanderán, Sind, Malabar and California, the passions and the sexual powers of the females greatly exceed those of their males, and hence a notable development of the crude form of polyandry popularly termed whoredom. Nor have the women of the Nile-valley improved under our rule. The last time I visited Cairo a Fellah wench, big, burly and boisterous, threatened one morning, in a fine new French avenue off the Ezbekiyah Gardens, to expose her person unless bought off with a piastre. And generally the condition of womenkind throughout the Nile-valley reminded me of that frantic outbreak of debauchery which characterised Afghanistan during its ill-judged occupation by Lord Auckland, and Sind after the conquest by Sir Charles Napier. “Captain Burton actually depends upon the respectable and antiquated D’Herbelot for his information” (p. 184). This silly skit at the two great French Orientalists, D’Herbelot and Galland, is indeed worthy of a clique which, puff and struggle however much it will, can never do a tithe of the good work found in the Bibliothèque Orientale. The book was issued in an unfinished state; in many
  • 58. points it has been superseded, during its life of a century and a half, by modern studies, but it is still a mine of facts, and a revised edition would be a boon to students. Again, I have consulted Prof. Palmer’s work, and the publications of the Palæographical Society (p. 184); but I nowhere find proofs that the Naskhi character (vol. i. 128) so long preceded the Cufic which, amongst vulgar Moslems, is looked upon like black letter in Europe. But Semitic epigraphy is only now entering upon its second stage of study, the first being mere tentative ignorance: about 80 years ago the illustrious De Sacy proved, in a learned memoir, the non-existence of letters in Arabia before the days of Mohammed. But Palmer,[455] Halevy, Robertson Smith, Doughty and Euting have changed all that, and Herr Eduard Glaser of Prague is now bringing back from Sana’á some 390 Sabæan epigraphs—a mass of new-old literature. And now, having passed in review, and having been much scandalised by “the extravagant claims of the complete translations over the Standard Version”—a term which properly applies only to the Editio princeps, 3 vols. 8vo.—the Edinburgh delivers a parting and insolent sting. “The different versions, however, have each its proper destination—Galland for the nursery, Lane for the library, Payne for the study, and Burton for the sewers” (p. 184). I need hardly attempt to precise the ultimate and well-merited office of his article: the gall in that ink may enable it hygienically to excel for certain purposes the best of “curl-papers.” Then our critic passes to the history of the work, concerning which nothing need be said: it is bodily borrowed from Lane’s Preface (pp. ix.–xv.), and his Terminal Review (iii. 735–47) with a few unimportant and uninteresting details taken from Al-Makrízí, and probably from the studies of the late Rogers Bey (pp. 191–92). Here the cult of the Uncle and Master emerges most extravagantly. “It was Lane who first brought out the importance of the ‘Arabian Nights’ as constituting a picture of Moslem life and manners” (p. 192); thus wholly ignoring the claims of Galland, to whom and whom alone the honour is due. But almost every statement concerning the French Professor involves more or less of lapse. “It was in 1704 that Antoine Galland, sometime of the
  • 59. French embassy at Constantinople, but then professor at the Collège de France, presented the world with the contents of an Arab Manuscript which he had brought from Syria, and which bore the title of ‘The Thousand Nights and One Night’” (p. 167), thus ignoring the famous Il a fallu le faire venir de Syrie. At that time (1704) Galland was still at Caen in the employ of “L’intendant Fouquet”; and he brought with him no MS., as he himself expressly assures us in Preface to his first volume. Here are two telling mistakes in one page, and in the next (p. 168) we find “As a professed translation Galland’s ‘Mille et une Nuits’ (N.B. the Frenchman always wrote Mille et une Nuit,)[456] is an audacious fraud.” It requires something more than “audacity” to offer such misstatement even in the pages of the Edinburgh, and can anything be falser than to declare “the whole of the last fourteen tales have nothing whatever to do with the ‘Nights’”? These bévues, which give us the fairest measure for the Reviewer’s competence to review, are followed (p. 189) by a series of obsolete assertions. “The highest authority on this point (the date) is the late Mr. Lane, who states his unqualified conviction that the tales represent the social life of mediæval Egypt, and he selects a period approaching the close of the fifteenth century as the probable date of collection, though some of the tales are, he believes, rather later” (p. 189). Mr. Lane’s studies upon the subject were painfully perfunctory. He distinctly states (Preface, p. xii.) that “the work was commenced and completed by one man,” or a least that “one man completed what another commenced.” With a marvellous want of critical acumen he could not distinguish the vast difference of style and diction, treatment and sentiments which at once strikes every intelligent reader, and which proves incontestably that many hands took part in the Great Saga-book. He speaks of “Galland’s very imperfect MS.,” but he never took the trouble to inspect the three volumes in question which are still in the Bibliothèque Nationale. And when he opines that “it (the work) was most probably not commenced earlier than the fifteenth century of our era” (Pref. p. xiii.) M. Hermann Zotenberg, judging from the style of writing, would
  • 60. attribute the MS. to the beginning[457] of the xivth century. The French Savant has printed a specimen page in his Histoire d’ ’Alâ al- Dîn (p. 6; see my Suppl. vol. iii., Foreword p. ix.); and now, at the request of sundry experts, he is preparing for publication other proofs which confirm his opinion. We must correct Lane’s fifteenth century to thirteenth century—a difference of only 200 years.[458] After this unhappy excursus the Reviewer proceeds to offer a most unintelligent estimate of the Great Recueil. “Enchantment” may be “a constant motive,” but it is wholly secondary and subservient: “the true and universal theme is love;” “‘all are but the ministers of love’ absolutely subordinate to the great theme” (p. 193). This is the usual half-truth and whole unfact. Love and war, or rather war and love, form the bases of all romantic fiction even as they are the motor power of the myriad forms and fashions of dancing. This may not appear from Lane’s mangled and mutilated version, which carefully omits all the tales of chivalry and conquest as the History of Gharíb and his brother ’Ajíb (vol. vi. 257) and that of Omar ibn Al- Nu’umán, “which is, as a whole, so very unreadable” (p. 172) though by no means more so than our European romances. But the reverse is the case with the original composition. Again, “These romantic lovers who will go through fire to meet each other, are not in themselves interesting characters: it may be questioned whether they have any character at all” (p. 195). “The story and not the delineation of character is the essence of the ‘Arabian Nights’” (p. 196). I can only marvel at the utter want of comprehension and appreciation with which this critic read what he wrote about: one hemisphere of his brain must have been otherwise occupied and his mental cecity makes him a phenomenon even amongst reviewers. He thus ignores all the lofty morale of the work, its marvellous pathos and humour, its tender sentiment and fine touches of portraiture, the personal individuality and the nice discrimination between the manifold heroes and heroines which combine to make it a book for all time. The critic ends his article with doing what critics should carefully avoid to do. After shrewdly displaying his powers of invective and
  • 61. depreciation he has submitted to his readers a sample of his own workmanship. He persists in writing “Zobeyda,” “Khalifa,” “Aziza” (p. 194) and “Kahramana” (p. 199) without the terminal aspirate which, in Arabic if not in Turkish, is a sine quâ non (see my Suppl. vol. v. 419). He preserves the pretentious blunder “The Khalif” (p. 193), a word which does not exist in Arabic. He translates (p. 181), although I have taught him to do better, “Hádimu ’l-Lizzáti wa Mufarriku ’l- Jama’át,” by “Terminator of Delights and Separator of Companies” instead of Destroyer of delights and Severer of societies. And lastly he pads the end of his article (pp. 196–199) with five dreary extracts from Lane (i. 372–373) who can be dull even when translating the Immortal Barber. The first quotation is so far changed that the peppering of commas (three to the initial line of the original) disappears to the reader’s gain, Lane’s textual date (App. 263) is also exchanged for that of the notes (A.H. 653); and the “æra of Alexander,” A.M. 7320, an absurdity which has its value in proving the worthlessness of such chronology, is clean omitted, because Lane used the worthless Bul. Edit. The latinisms due to Lane show here in force—“Looked for a considerable time” (Maliyyan = for a long while); “there is an announcement that presenteth itself to me” (a matter which hath come to my knowledge), and “thou hast dissipated[459] my mind” (Azhakta rúhí = thou scatterest my wits, in the Calc. Edit. Saghgharta rúhí = thou belittlest my mind). But even Lane never wrote “I only required thee to shave my head”—the adverb thus qualifying, as the ignoramus loves to do, the wrong verb—for “I required thee only to shave my head.” In the second échantillon we have “a piece of gold” as equivalent of a quarter-dinar and “for God’s sake” which certainly does not preserve local colour. In No. 3 we find “‘May God,’ said I,” etc.; “There is no deity but God! Mohammed is God’s apostle!”. Here Allah ought invariably to be used, e.g. “Mohammed is the Apostle of Allah,” unless the English name of the Deity be absolutely required as in “There is no god but the God.” The Moslem’s “Wa’lláhi” must not be rendered “By God,” a verbal translation and an absolute non-equivalent; the terms Jehovah, Allah
  • 62. and God and the use of them involving manifold fine distinctions. If it be true that God made man, man in his turn made and mismade God who thus becomes a Son of Man and a mere racial type. I need not trouble my reader with further notices of these extracts whose sole use is to show the phenomenal dullness of Lane’s latinised style: I prefer even Torrens (p. 273). “We have spoken severely with regard to the last” (my version) says the Reviewer (p. 185) and verily I thank him therefor. Laudari ab illaudato has never been my ambition. A writer so learned and so disinterested could hurt my feelings and mortify my pride only by approving me and praising me. Nor have I any desire to be exalted in the pages of the Edinburgh, so famous for its incartades of old. As Dryden says “he has done me all the honour that any man can receive from him, which is to be railed at by him.” I am content to share the vituperation of this veteran-incapable in company with the poetaster George Gordon who suffered for “this Lord’s station;” with that “burnisht fly in the pride of May,” Macaulay; and with the great trio, Darwin, Huxley and Hooker, who also have been the butts of his bitter and malignant abuse (April ’63 and April ’73). And lastly I have no stomach for sweet words from the present Editor of the Edinburgh, Mr. Henry Reeve, a cross and cross-grained old man whose surly temper is equalled only by his ignoble jealousy of another’s success. Let them bedevil the thin-skinned with their godless ribaldry; for myself peu m’importe—my shoulders are broad enough to bear all their envy, hatred and malice. During the three years which have elapsed since I first began printing my book I have not had often to complain of mere gratuitous impertinence and a single exception deserves some notice. The following lines which I addressed to The Academy (August 11 ’88) will suffice to lay my case before my readers:— THE BESTIAL ELEMENT IN MAN. “One hesitates to dissent from so great an authority as Sir Richard Burton on all that relates to the bestial element in man.” So writes (p. xli., Introduction to the Fables of Pilpay), with uncalled for impertinence, Mr. Joseph Jacobs, who goes out
  • 63. of his way to be offensive, and who confesses to having derived all his knowledge of my views not from “the notorious Terminal Essay of the Nights,” but from the excellent article by Mr. Thomas Davidson on “Beast-fables,” in Chambers’s Cyclopædia, Edinburgh, 1888. This lofty standpoint of morality was probably occupied for a reason by a writer who dedicates “To my dear wife” a volume rich in anecdotes grivoises, and not poor in language the contrary of conventional. However, I suffer from this Maccabee in good society together with Prof. Max Müller (pp. xxvi. and xxxiii.), Mr. Clouston (pp. xxxiii. and xxxv.), Byron (p. xlvi.), Theodor Benfey (p. xlvii.), Mr. W. G. Rutherford (p. xlviii.), and Bishop Lightfoot (p. xlix.). All this eminent halfdozen is glanced at, with distinct and several sneers, in a little volume which, rendered useless by lack of notes and index, must advertise itself by the réclame of abuse. As regards the reminiscence of Homo Darwiniensis by Homo Sapiens, doubtless it would ex hypothesi be common to mankind. Yet to me Africa is the old home of the Beast-fable, because Egypt was the inventor of the alphabet, the cradle of letters, the preacher of animism and metempsychosis, and, generally, the source of all human civilisation. Richard F. Burton. And now I must proceed a trifle further a-field and meet
  • 64. THE CRITIC IN ANGLO-AMERICA. The Boston Daily Advertiser (Jan. 26 ’86) contains the following choice morceau which went the round of the Transatlantic Press:— G. W. S. writes from London to the New York Tribune in regard to Captain Burton’s notorious translation of the “Arabian Nights.” Of Captain Burton’s translation of “The Arabian Nights,” two volumes have now appeared. Before anything had been seen of them, I gave some account of this scheme, and of the material on which he had worked, with a statement of the reasons which made all existing versions unsatisfactory to the student, and incomplete. Captain Burton saw fit to reprint these desultory paragraphs as a kind of circular or advertisement on his forthcoming book. He did not think it necessary to ask leave to do this, nor did I know to what use my letter had been put till it was too late to object. In any ordinary case it would have been of no consequence, but Captain Burton’s version is of such a character that I wish to state the facts, and to say that when I wrote my letter I had never seen a line of his translation, and had no idea that what I said of his plans would be used for the purpose it has been, or for any purpose except to be printed in your columns. As it is, I am made to seem to give some sort of approval to a book which I think offensive, and not only offensive, but grossly and needlessly offensive. If anybody has been induced to subscribe for it by what I wrote I regret it, and both to him and to myself I think this explanation due. Mr. Smalley is the London correspondent of the New York Tribune, which represents Jupiter Tonans in the Western World. He may be unable to write with independent tone—few Anglo-Americans can afford to confront the crass and compound ignorance of a “free and independent majority;”—but even he is not called upon solemnly to state an untruth. Before using Mr. Smalley’s article as a circular, my representative made a point of applying to him for permission, as he indeed was bound to do by the simplest rules of courtesy. Mr. Smalley replied at once, willingly granting the favour, as I can prove by the note still in my possession; and presently, frightened by the puny yelping of a few critical curs at home, he has the effrontery to deny the fact.
  • 65. In my last volumes I have been materially aided by two Anglo- American friends MM. Thayer and Cotheal and I have often had cause to thank the Tribune and the Herald of New York for generously appreciating my labours. But no gratitude from me is due to the small fry of the Transatlantic Press which has welcomed me with spiteful little pars., mostly borrowed from unfriends in England and mainly touching upon style and dollars. In the Mail Express of New York (September 7, ’85) I read, “Captain Richard Burton, traveller and translator, intends to make all the money that there may be in his translation of the ‘Arabian Nights.’ * * * If he only fills his list, and collects his money he will be in easy circumstances for the remainder of his days.” In a subsequent issue (Oct. 24) readers are told that I have been requested not to publish the rest of the series under pain of legal prosecution. In the same paper (October 31, ’85: see also November 7, ’85) I find:— The authorities have discovered where Capt. Burton’s “Thousand and One Nights” is being printed, despite the author’s efforts to keep the place a secret, but are undecided whether to suppress it or to permit the publication of the coming volumes. Burton’s own foot-notes are so voluminous that they exceed the letterpress of the text proper, and make up the bulk of the work.[460] The foulness of the second volume of his translation places it at a much higher premium in the market than the first. The Tribune of Chicago (October 26, ’85) honours me by declaring “It has been resolved to request Captain Burton not to publish the rest of his translation of the ‘Thousand and One Nights,’ which is really foul and slipshod as to style.” The New York Times (October 17 and November 9, ’85) merely echoes the spite of its English confrère:— Capt. Burton’s translation of the “Arabian Nights” bears the imprint “Benares.” Of course the work never saw Benares. America, France, Belgium and Germany have all been suggested as the place of printing, and now the Pall Mall Gazette affirms that the work was done “north of the Tweed.” There is, without doubt, on British soil, it says, “a press which year after year produces scores of obscene publications.” And the same is the case with the St. Louis Post Dispatch (November 11, ’85); the Mail Express of New York (November 23,
  • 66. ’85); the Weekly Post of Boston (November 27, ’85) which again revives a false report and with the Boston Herald (December 16, ’85). The Chicago Daily News (January 30, ’86) contains a malicious sneer at the Kamashastra Society. The American Register (Paris, July 25, ’86) informs its clientèle, “If, as is generally supposed, Captain Burton’s book is printed abroad, the probability is that every copy will on arrival be confiscated as ‘indecent’ by the Custom-house.” And to curtail a long list of similar fadaises I will quote the Bookmart (of Pittsburg, Pa. U.S.A., October, ’86): “Sir Richard Burton’s ‘Nights’ are terribly in want of the fig-leaf, if anything less than a cabbage- leaf will do, before they can be fit (fitted?) for family reading. It is not possible (Is it not possible?) that by the time a household selection has been sifted out of the great work, everything which makes the originality and the value—such as it is—of Richard’s series of volumes will have disappeared, and nothing will remain but his diverting lunacies of style.” The Bookmart, I am informed, is edited by one Halkett Lord, an unnaturalised Englishman who finds it pays best to abuse everything and everyone English. And lastly the Springfield Republican (April 5, ’88) assures me that I have published “fully as much as the (his?) world wants of the ‘Nights’.” In the case of “The Nights,” I am exposed to that peculiar Protestant form of hypocrisy, so different from the Tartuffean original of Catholicism, and still as mighty a motor force, throughout the length and breadth of the North-American continent, as within the narrow limits of England. There also as here it goes hand-in-hand with “Respectability” to blind judgment and good sense. A great surgeon of our day said (or is said to have said) in addressing his students:—“Never forget, gentlemen, that you have to deal with an ignorant public.” The dictum may fairly be extended from medical knowledge to general information amongst the many- headed of England; and the Publisher, when rejecting a too recondite book, will repeat parrot-fashion, The English public is not a learned body. Equally valid is the statement in the case of the Anglo- American community which is still half-educated and very far from being erudite. The vast country has produced a few men of great
  • 67. and original genius, such as Emerson and Theodore Parker, Edgar Allan Poe and Walt. Whitman; but the sum total is as yet too small to leaven the mighty mass which learns its rudiments at school and college and which finishes its education with the newspaper and the lecture. When Emerson died it was said that the intellectual glory of a continent had departed; but Edgar A. Poe, the peculiar poetic glory of the States, the first Transatlantic who dared be himself and who disdained to borrow from Schiller and Byron, the outlander poet who, as Edgar Allan Poé, is now the prime favourite in France, appears to be still under ban because he separated like Byron from his spouse, and he led a manner of so-called “Bohemian” life. Indeed the wide diffusion of letters in the States, that favourite theme for boasting and bragging over the unenlightened and analphabetic Old World, has tended only to exaggerate the defective and disagreeable side of a national character lacking geniality and bristling with prickly individuality. This disposition of mind, whose favourable and laudable presentations are love of liberty and self- reliance, began with the beginnings of American history. The “Fathers,” Pilgrim and Puritan, who left their country for their country’s good and their own, fled from lay tyranny and clerkly oppression only to oppress and tyrannise over others in new and distant homes. Hardly had a century and a half elapsed before the sturdy colonists, who did not claim freedom but determined to keep it, formally revolted and fought their way to absolute independence —not, by-the-by, a feat whereof to be overproud when a whole country rose unanimously against a handful of troops. The movement, however, reacted powerfully upon the politics of Europe which stood agape for change, and undoubtedly precipitated the great French Revolution. As soon as the States became an empire, their democratic and republican institutions at once attracted hosts of emigrants from the Old World, thus peopling the land with a selection of species: the active and the adventurous, the malcontent and the malefactor readily expatriate themselves while the pauvre diable remains at home. The potato-famine in Ireland (1848) gave an overwhelming impetus to the exode of a race which had never known a racial baptism; and, lastly, the Germans flying from the
  • 68. conscription, the blood-tax of the Fatherland, carried with them over the ocean a transcendentalism which has engendered the wildest theories of socialism and communism. And the emigration process still continues. Whole regions, like the rugged Bocche di Cattaro in Dalmatia and pauper Iceland, are becoming depopulated: to me the wonder is that a poor man ever consents to live out of America or a rich man to live in it. The result of such selection has been two-fold. The first appears in a splendid self-esteem, a complacency, a confidence which passes all bounds of the golden mean. “I am engrossed in calmly contemplating the grandeur of my native country and her miraculous growth,” writes to me an old literary friend. The feeling normally breaks out in the grossest laudation of everything American. The ultra-provincial twang which we still hear amongst the servant- classes of Lancashire and Yorkshire, and which is so notable in the nouveau riche, modified by traditional nasalisation and, as in Australia, by climatic influences, is American and, therefore, the purest of English utterances. The obsolete vocabulary—often obsolete in England without just reason—contrasting with a modern disfigured etymology which strips vocables of their genealogy and history, is American and ergò admirably progressive. The spurious facetiousness which deals mainly in mere jargon, words ill-spelt and worse pronounced; in bizarre contrast of ideas, and in ultra- Rabelaisian exaggeration, is American wit and humour—therefore unsurpassable. The Newspaper Press, that great reflector of nationalities, that prime expression of popular taste, too often of an écœurant vulgarity, personal beyond all bounds of common decency, sensational as a transpontine drama, is American; America is the greatest nation upon earth’s face; ergò the daily sheet is setting-up the standard of English speech and forming the language of the Future, good and too good for all the world. This low standard of the Press is the more regretable as its exalted duty is at present to solve the highest problems social and industrial, such as co-operation in labour, the development of fisheries, direct taxation versus indirect
  • 69. and a host of enigmas which the young world, uncumbered by the burdens of the Old World, alone shall unravel. The second result is still more prejudicial and perilous. This is the glorification of mediocrity, of the average man and woman whose low standard must be a norm to statesman and publicist. Such cult of the common and the ignoble is the more prejudicial because it “wars against all distinction and against the sense of elevation to be gained by respecting and admiring superiority.” Its characteristic predominance in a race which, true to its Anglo-Saxon origin, bases and builds the strongest opinions upon the weakest foundations, hinders the higher Avatars of genius and interferes with the “chief duty of a nation which is to produce great men.” It accounts for the ever-incroaching reign of women in literature—meaning as a rule cheap work and second-rate. And the main lack is not so much the “thrill of awe,” which Goethe pronounces to be the best thing humanity possesses, but that discipline of respect, that sense of loyalty, not in its confined meaning of attachment to royalty, but in a far higher and nobler signification, the recognising and welcoming elevation and distinction whatever be the guise they may assume. “The soul lives by admiration and hope and love.” And here we see the shady side of the educational process, the diffusion of elementary and superficial knowledge, of the veneer and polish which mask, until chipped-off, the raw and unpolished material lying hidden beneath them. A little learning is a dangerous thing because it knows all and consequently it stands in the way of learning more or much. Hence it is sorely impatient of novelty, of improvement, of originality. It is intolerant of contradiction, irritable, thin-skinned, and impatient of criticism, of a word spoken against it. It is chargeable with the Law of Copyright, which is not only legalised plunder of the foreigner, but is unfair, unjust and ungenerous to native talent for the exclusive benefit of the short- sighted many-headed. I am far from charging the United States with the abomination called “International Copyright;” the English publisher is as sturdy an enemy to “protection” as the Transatlantic statesman; but we expect better things from a new people which
  • 70. enjoys the heritage of European civilisation without the sufferings accompanying the winning of it. This mediocrity has the furious, unpardoning hatred of l’amour propre offensé. Even a word in favour of my old friends the Mormons is an unpardonable offence: the dwarfish and dwarfing demon “Respectability” has made their barbarous treatment a burning shame to a so-called “free” country: they are subjected to slights and wrongs only for practising polygamy, an institution never condemned by Christ or the early Christians. The calm and dispassionate judgments of Sir Lepel Griffith and the late Matthew Arnold, who ventured to state, in guarded language, that the boasted civilisation of the United States was not quite perfect, resulted in the former being called a snob and the latter a liar. English stolidity would only have smiled at the criticism even had it been couched in the language of persiflage. And when M. Max O’Rell traverses the statements of the two Englishmen and exaggerates American civilisation, we must bear in mind first that la vulgarité ne se traduit pas, and secondly, that the foes of our foemen are our friends. Woe be to the man who refuses to fall down and do worship before that brazen-faced idol (Eidolon Novi Mundi), Public Opinion in the States; unless, indeed, his name be Brown and he hail from Briggsville. Some years ago I proposed to write a paper upon the reflex action of Anglo-America upon England, using as a base the last edition of Mrs. Trollope, who was compelled to confess that almost every peculiarity which she had abused in her first issue had become naturalised at home. Yankee cuteness has already displaced in a marvellous way old English rectitude and plain-dealing; gambling on the Stock Exchange, cornering, booms and trusts have invaded the trading-classes from merchant-princes to shopkeepers and threaten, at their actual rate of progress, not to leave us an honest man. But now the student’s attention will be called to the great and ever- growing influence of the New World upon the Old, and notably upon Europe. Some 50,000 Americans annually visit the continent, they are rapidly becoming the most important item of the floating population, and in a few years they will number 500,000. Meanwhile
  • 71. they are revolutionising all the old institutions; they are abolishing the classical cicerone whose occupation is gone amongst a herd which wants only to see streets and people: they greatly increase the cost of travelling; they pay dollars in lieu of francs, and they are satisfied with inferior treatment at superior prices:—hence the American hotel abroad is carefully shunned by Englishmen and natives. At home the “well-to-do-class” began by regarding their kinsmen d’outre mer with contemptuous dislike; then they looked upon them as a country squire would regard a junior branch which has emigrated and has thriven by emigration; and now they are welcomed in Society because they amuse and startle and stir up the duller depths. But however warm may be private friendship between Englishmen and Anglo-Americans there is no public sympathy nor is any to be expected from the present generation. “New England does not understand Old England and never will,” the reverse being equally the fact. “The Millennium must come” says Darwin (ii. 387) “before nations love each other:” I add that first Homo alalus seu Pithecanthropus must become Homo Sapiens and cast off his moral slough—egoism and ignorance. Mr. Cleveland, in order to efface the foul stigma of being the “English President,” found it necessary to adopt the strongest measures in the matter of “Fisheries;” and the “Irish vote” must quadrennially be bought at the grave risk of national complications. Despite the much-bewritten “brotherhood of the two great English-speaking races of the world,” the old leaven of cousinly ill-feeling, the jealousy which embitters the Pole against his Russian congener, is still rampant. Uncle Sam actively dislikes John Bull and dispraises England. An Anglo-American who has lived years amongst us and in private intimacy must, when he returns home, speak disparagingly of the old country unless he can afford the expensive luxury of telling unpopular truths and of affronting Demos, the hydraheaded. But there are even now signs of better things in the Great Republic. Mr. James R. Lowell, an authority (if there be any) upon the subject of Democracy, after displaying its fine points and favourable aspects in his addresses to English audiences, has at length had the
  • 72. uncommon courage to discuss family affairs, and to teach Boston and New York what “weaknesses and perils there may be in the practical working of a system never before set in motion under such favourable circumstances, nor on so grand a scale.” He is emboldened to say firmly and aloud, despite the storming of false and hollow self-praise, that American civilisation, so strong on the material side, is sadly wanting on the other, and still lacks much to make it morally acceptable or satisfactory. And we have home truths concerning that Fool’s Paradise the glorification of the “average man.” Every citizen of the world must wish full success to the “Independents” (in politics) who sit at the feet of so wise and patriotic a teacher. And here I feel myself bound to offer some explanation concerning
  • 73. THE HOUSEHOLD EDITION OF THE ARABIAN NIGHTS, lest any subscriber charge me, after contracting not to issue or to allow the issue of a cheaper form, with the sharp practice which may be styled To keep the word of promise to our ear And break it to our hope. Hardly had my third volume of “The Nights” (proper) been issued to my patrons when a benevolent subscriber, whose name I am bound to conceal, apprised me that he had personal and precise information concerning a project to pirate the production. England and Anglo-America, be it observed, are the only self-styled civilised countries in the world where an author’s brain-work is not held to be his private property: his book is simply no book unless published and entered, after a cost of seven presentation copies, at “Stationers’ Hall”—its only ægis. France, Italy and Austria treat such volumes as private MSS.: here any dishonest house may reproduce them in replica without the slightest regard to the writer’s rightful rights. In my case this act of robbery was proposed by a German publisher domiciled in London, supported by a Frenchman equally industrious, who practises in Paris, and of whose sharp doings in money-matters not a few Englishmen have had ample reason bitterly to complain. This par nobile agreed to print in partnership an issue of handier form and easier price than my edition, and their plan if carried out would have seriously damaged the property of my subscribers: the series which cost them £10 10s. would have fallen probably to one- half value. The two pirates met by agreement in Paris, where the design was duly discussed and determined; but, fortunately for me, an unexpected obstacle barred the way. The London solicitor, professionally consulted by the dishonest firm, gave his opinion that such a work publicly issued would be a boon to the Society for the
  • 74. Suppression of Vice, and would not escape the unsavoury attentions of old Father Antic—the Law. But, although these two men were deterred by probable consequences, a bolder spirit might make light of them. I had never intended to go beyond my original project; that is, of printing one thousand copies and no more; nor did I believe that any cunning of disguise could make “The Nights” presentable in conventionally decent society. It was, however, represented to me by many whose opinions I valued that thus and thus only the author and his subscribers could be protected from impudent fraud, and finally an unwilling consent was the result. Mr. Justin Huntley McCarthy, a name well known in the annals of contemporary literature, undertook the task of converting the grand old barbarian into a family man to be received by the “best circles.” His proofs, after due expurgation, were passed on to my wife, who I may say has never read the original, and she struck out all that appeared to her over-free, under the promise that no mother should hesitate in allowing the book to her daughters. It would, perhaps, surprise certain “modest gentlemen” and blatantly virtuous reviewers that the amount of raw material excised from the text and the notes, chiefly addressed to anthropologists and Orientalists, amounts to only 215 pages out of a grand total numbering 3,156. Between 1886 and 1888 appeared the revision in six pretty volumes, bearing emblematic colours, virgin-white adorned with the golden lilies of St. Joseph and the “chaste crescent of the young moon.” The price also was reduced to the lowest (£3 3s.) under the idea that the work would be welcome if not to families at any rate to libraries and reading-rooms, for whose benefit the older translations are still being reproduced. But the flattering tale of Hope again proved to be a snare and a delusion; I had once more dispensed with the services of Mr. Middleman, the publisher, and he naturally refused to aid and abet the dangerous innovation. The hint went abroad that the book belonged to the category which has borrowed a name from the ingenious Mr. Bowdler, and vainly half a century of reviewers spoke
  • 75. bravely in its praise. The public would have none of it: even innocent girlhood tossed aside the chaste volumes in utter contempt, and would not condescend to aught save the thing, the whole thing, and nothing but the thing, unexpurgated and uncastrated. The result was an unexpected and unpleasant study of modern taste in highly respectable England. And the fact remains that of an edition which began with a thousand copies only 457 were sold in the course of two years. Next time I shall see my way more clearly to suit the peculiar tastes and prepossessions of the reading world at home. Before dismissing the subject of the Household Edition, I would offer a few words of explanation on the part of the Editress. While touching-up and trimming the somewhat hurried work of our friend, Mr. McCarthy, she was compelled to accompany me abroad, and to nurse me through a dangerous illness, which left but little time for the heavy claims of business. Unable to superintend, with the care required, the issue of her six volumes she entrusted the task to two agents in whose good will and experience she had and still has the fullest confidence; but the results were sundry letters of appeal and indignation from subscribers touching matters wholly unknown and unintelligible to her. If any mistakes have been made in matters of detail she begs to express her sincerest regret, and to assure those aggrieved that nothing was further from her intention than to show discourtesy where she felt cordial gratitude was due. Nothing now remains for me but the pleasant task of naming the many friends and assistants to whom this sixteenth and last volume has been inscribed. The late Reverend G. Percy Badger strongly objected to the literal translation of “The Nights” (The Academy, December 8, ’81); not the less, however, he assisted me in its philology with all readiness. Dr. F. Grenfell Baker lent me ready and valuable aid in the mechanical part of my hard labour. Mr. James F. Blumhardt, a practical Orientalist and teacher of the Prakrit dialects at Cambridge, englished for me the eight Gallandian tales (Foreword, Supp. vol. iii.) from the various Hindostan versions. To Mr. William H. Chandler, of Pembroke College, Oxford, I have
  • 76. Welcome to Our Bookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com