Full Download The Linux Command Line A Complete Introduction Second Edition William Shotts PDF
Full Download The Linux Command Line A Complete Introduction Second Edition William Shotts PDF
Full Download The Linux Command Line A Complete Introduction Second Edition William Shotts PDF
com
OR CLICK BUTTON
DOWLOAD NOW
More products digital (pdf, epub, mobi) instant
download maybe you interests ...
https://ebookmeta.com/product/the-linux-command-line-a-complete-
introduction-2nd-edition-william-shotts/
https://ebookmeta.com/product/the-linux-command-line-a-complete-
introduction-2d-edition-william-e-shotts/
https://ebookmeta.com/product/efficient-linux-at-the-command-
line-boost-your-command-line-skills-1st-edition-daniel-j-barrett/
https://ebookmeta.com/product/linux-installation-configuration-
and-command-line-basics-1st-edition-nathan-clark/
Linux introduce to beginners guide UNIX operating
system Linux shell scripting and command line Linux
System 1st Edition Erickson Karnel & Coding Hood
https://ebookmeta.com/product/linux-introduce-to-beginners-guide-
unix-operating-system-linux-shell-scripting-and-command-line-
linux-system-1st-edition-erickson-karnel-coding-hood/
https://ebookmeta.com/product/command-line-rust-1st-edition-ken-
youens-clark/
https://ebookmeta.com/product/william-shakespeare-complete-works-
second-edition-royal-shakespeare-company-william-shakespeare/
https://ebookmeta.com/product/take-control-of-the-mac-command-
line-with-terminal-3rd-edition-joe-kissell/
https://ebookmeta.com/product/linux-the-complete-manual-2nd-
edition-2021/
THE LINUX COMMAND LINE
2ND EDITION
A Complete Introduction
by William Shotts
San Francisco
THE LINUX COMMAND LINE, 2ND EDITION. Copyright © 2019 by
William Shotts.
All rights reserved. No part of this work may be reproduced or transmitted in any
form or by any means, electronic or mechanical, including photocopying, recording,
or by any information storage or retrieval system, without the prior written permission
of the copyright owner and the publisher.
ISBN-10: 1-59327-952-3
ISBN-13: 978-1-59327-952-3
Publisher: William Pollock
Production Editors: Meg Sneeringer and Serena Yang
Cover Illustration: Octopod Studios
Developmental Editor: Chris Cleveland
Technical Reviewer: Jordi Gutiérrez Hermoso
Copyeditor: Kim Wimpsett
Compositors: Britt Bogan and Meg Sneeringer
Proofreader: James Fraleigh
For information on distribution, translations, or bulk sales, please contact No Starch
Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900; [email protected]
www.nostarch.com
The Library of Congress issued the following Cataloging-in-Publication Data for the first
edition:
Shotts, William E.
The Linux command line: a complete introduction / William E. Shotts, Jr.
p. cm.
Includes index.
ISBN-13: 978-1-59327-389-7 (pbk.)
ISBN-10: 1-59327-389-4 (pbk.)
1. Linux. 2. Scripting Languages (Computer science) 3. Operating
systems (Computers) I. Title.
QA76.76.O63S5556 2011
005.4'32--dc23
2011029198
No Starch Press and the No Starch Press logo are registered trademarks of No Starch
Press, Inc. Other product and company names mentioned herein may be the
trademarks of their respective owners. Rather than use a trademark symbol with every
occurrence of a trademarked name, we are using the names only in an editorial fashion
and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The information in this book is distributed on an “As Is” basis, without warranty.
While every precaution has been taken in the preparation of this work, neither the
author nor No Starch Press, Inc. shall have any liability to any person or entity with
respect to any loss or damage caused or alleged to be caused directly or indirectly by
the information contained in it.
To Karen
About the Author
William Shotts has been a software professional for more than 30 years
and an avid Linux user for more than 20 years. He has an extensive
background in software development, including technical support,
quality assurance, and documentation. He is also the creator of
LinuxCommand.org, a Linux education and advocacy site featuring news,
reviews, and extensive support for using the Linux command line.
About the Technical Reviewer
Jordi Gutiérrez Hermoso is a coder, mathematician, and hacker-errant.
He runs Debian GNU/Linux exclusively since 2002, both at home and
at work. Jordi has been involved with GNU Octave, a free numerical
computing environment largely compatible with Matlab, and with
Mercurial, a distributed version control system. He enjoys pure and
applied mathematics, skating, swimming, and knitting. Nowadays he
thinks a lot about environmental mapping, greenhouse gas emissions,
and rhino conservation efforts.
BRIEF CONTENTS
Acknowledgments
Introduction
INTRODUCTION
Why Use the Command Line?
What This Book Is About
Who Should Read This Book
What’s in This Book
How to Read This Book
Prerequisites
What’s New in the Second Edition
Your Feedback Is Needed!
1
WHAT IS THE SHELL?
Terminal Emulators
Making Your First Keystrokes
Command History
Cursor Movement
Try Some Simple Commands
Ending a Terminal Session
Summing Up
2
NAVIGATION
Understanding the File System Tree
The Current Working Directory
Listing the Contents of a Directory
Changing the Current Working Directory
Absolute Pathnames
Relative Pathnames
Some Helpful Shortcuts
Summing Up
3
EXPLORING THE SYSTEM
More Fun with ls
Options and Arguments
A Longer Look at Long Format
Determining a File’s Type with file
Viewing File Contents with less
Taking a Guided Tour
Symbolic Links
Hard Links
Summing Up
4
MANIPULATING FILES AND DIRECTORIES
Wildcards
mkdir—Create Directories
cp—Copy Files and Directories
Useful Options and Examples
mv—Move and Rename Files
Useful Options and Examples
rm—Remove Files and Directories
Useful Options and Examples
ln—Create Links
Hard Links
Symbolic Links
Building a Playground
Creating Directories
Copying Files
Moving and Renaming Files
Creating Hard Links
Creating Symbolic Links
Removing Files and Directories
Summing Up
5
WORKING WITH COMMANDS
What Exactly Are Commands?
Identifying Commands
type—Display a Command’s Type
which—Display an Executable’s Location
Getting a Command’s Documentation
help—Get Help for Shell Builtins
--help—Display Usage Information
man—Display a Program’s Manual Page
apropos—Display Appropriate Commands
whatis—Display One-line Manual Page Descriptions
info—Display a Program’s Info Entry
README and Other Program Documentation Files
Creating Our Own Commands with alias
Summing Up
6
REDIRECTION
Standard Input, Output, and Error
Redirecting Standard Output
Redirecting Standard Error
Redirecting Standard Output and Standard Error to One File
Disposing of Unwanted Output
Redirecting Standard Input
cat: Concatenate Files
Pipelines
Filters
uniq: Report or Omit Repeated Lines
wc: Print Line, Word, and Byte Counts
grep: Print Lines Matching a Pattern
head/tail: Print First/Last Part of Files
tee: Read from Stdin and Output to Stdout and Files
Summing Up
7
SEEING THE WORLD AS THE SHELL SEES IT
Expansion
Pathname Expansion
Tilde Expansion
Arithmetic Expansion
Brace Expansion
Parameter Expansion
Command Substitution
Quoting
Double Quotes
Single Quotes
Escaping Characters
Backslash Escape Sequences
Summing Up
8
ADVANCED KEYBOARD TRICKS
Command Line Editing
Cursor Movement
Modifying Text
Cutting and Pasting (Killing and Yanking) Text
Completion
Using History
Searching History
History Expansion
Summing Up
9
PERMISSIONS
Owners, Group Members, and Everybody Else
Reading, Writing, and Executing
chmod: Change File Mode
Setting File Mode with the GUI
umask: Set Default Permissions
Some Special Permissions
Changing Identities
su: Run a Shell with Substitute User and Group IDs
sudo: Execute a Command As Another User
chown: Change File Owner and Group
chgrp: Change Group Ownership
Exercising Our Privileges
Changing Your Password
Summing Up
10
PROCESSES
How a Process Works
Viewing Processes
Viewing Processes Dynamically with top
Controlling Processes
Interrupting a Process
Putting a Process in the Background
Returning a Process to the Foreground
Stopping (Pausing) a Process
Signals
Another random document with
no related content on Scribd:
As flowers turn toward the sun all day, and seem to follow him in
his course, so should we let our hearts turn to the God who made
us; for he is our bright Sun, and without him we should fade and
die.
Christmas.
chapter xiv.
The Conclusion.
After the little community of Fredonia had provided for their first
wants,—houses, clothes, and food,—they began to think of other
things. There were several children among them, and for these they
required a school. Accordingly they employed a young woman, who
had been well educated; and a place being provided, the children
were assembled together, and she taught them as well as she could.
She had few books, however; for neither the works of Peter Parley
or Robert Merry had then been written. Nor were there any
bookstores or printing-offices. There was one copy of a Bible, and in
this the children were, one after another, taught to read.
In all that could make the people happy, M. Bonfils, the good old
governor, took a lively interest. He did not confine himself merely to
a routine of official acts, but he was constantly considering how he
could influence the people in such a way as to make them live
better, more comfortably, and more happily. Being a wise man, he
thus exercised a great influence; and I beg my young readers to
remember, that in this way—by the exercise of wisdom and
patriotism—rulers may be great blessings to their country.
The governor had a notion, which you may think strange, but I
will mention it to you. His idea was, that no person can be happy
without religion. He was a Catholic himself, but he did not insist that
all should think exactly as he did on this subject. What he desired,
was, that every person should love and fear God with sincerity. He
maintained that no nation could be honest, virtuous, industrious, or
patriotic, without religion; and that an enemy to religion was always
an enemy to good government; always an enemy to the true
interests of mankind, even if we only regard the affairs of human
society in this world.
He therefore was desirous of sustaining the institutions of
religion, and for this purpose it was his custom, every Sabbath, to
get the people together, and offer up prayers, and make some kind
of address. It was a beautiful thing to see the people gathered
beneath a group of palm trees, and all kneeling in prayer, or listening
to the exhortations of the gray-haired patriarch who addressed
them. It was also a beautiful thing to hear them joining in their
hymns, of which they were able to sing a few from recollection.
Thus it was that society advanced one step after another, and no
doubt their improvement arose from the happy guidance of their
governor. How different was the state of the people from what it
would have been if Rogére had succeeded in making himself king!
He was perfectly selfish, and he would have subjected all around to
his own personal wishes and interests. Even if he had suppressed
riot and turmoil and anarchy by a strong hand, still the people would
gradually have sunk lower in the scale of civilization: a few would
have been lords and the rest slaves. But now, under the government
of M. Bonfils, they enjoyed equal rights and privileges; each one was
secure of his house, his home, and his lands, and the produce of his
labor. Justice was also duly administered; morality and religion were
cherished; education encouraged; peace, industry, and good
neighborhood became the established and habitual virtues of
society. These are the results, in a great degree, of the conduct and
character of the ruler of the little kingdom; and it ought to teach us
the importance of having good, wise, and religious rulers.
Thus affairs went on, till the good old governor became very
feeble, and was unable longer to attend to the affairs of
government. He had drawn up a plan for a constitution, and upon
resigning his office, submitted it to the people for their ratification or
rejection. It was another pleasing consequence of the virtues of the
good old sage, that what he recommended, came with the force of a
command, and was immediately adopted by the people. Thus,
without agitation or disturbance, the nation adopted a free
constitution, and thenceforward, they enjoyed that greatest of
blessings—the privilege of self-government.
It is not my purpose to extend this story further, nor have I
indeed the means. About a year after François had completed his
little vessel, he made a trip to the Isle of France, where he obtained
a great variety of articles needed by the Fredonians. During his stay
there, which however was brief, he related the events which we
have been detailing. He soon set out on his return, from which time
we have not heard from the little island which has so long occupied
the attention of our readers. If we get any news from them, it shall
be immediately laid before our friends of the blue and black eyes.
Winter is coming.
One grand object of the king, Henry IV. of France, was to promote
the arts and manufactures. The silk trade of Lyons owes its birth to
him. Thinking to benefit trade and commerce, he encouraged his
courtiers in habits of expense, quite opposite to his own frugal
habits.
The expense of dress became enormously great on account of the
quantity of gold, silver, and jewels with which it was decorated. It
was not only costly, but dreadfully heavy. It is related of one of the
ladies of the court, that, when she was in full dress, she was so
encumbered by the weight of her finery as to be unable to move, or
even to stand.
The dress of a gentleman of the day is thus described: “He was
clothed in silver tissue; his shoes were white, and also his stockings.
His cloak was black, bordered with rich embroidery and lined with
cloth of silver; his bonnet was of black velvet, and he wore besides a
profusion of precious stones.”
The ruff had been laid aside in the last reign, because Henry III.
took it into his head that the person whose business it was to pin on
his ruff, had been bribed to scratch him on the neck with a poisoned
pin.
Its place, so far as the ladies were concerned, was supplied by a
sort of frame of wire and lace, in which the head was enclosed, and
which, in compliment to the queen, was called a Medicis. Masks
were much worn by both sexes. They were made of black velvet,
and were so necessary a part of the out-door costume of a lady, that
she was thought to be in dishabille if seen without one.
This weight of dress led to the introduction of a new luxury. The
ladies could no longer ride to court on horseback. Coaches were
therefore employed to carry them. The first coach made its
appearance in Paris, in the reign of Henry II.
For a long time, there were but three in the whole city. The queen
had one; a great court lady had another; and the third belonged to
an old nobleman, “who, being too fat to ride on horseback, was
obliged to submit to the mortification of being carried in a coach like
a woman.”
The tapestry, carpets, and bed hangings of the houses
corresponded in splendor and costliness with the dress. When the
constable Montmorenci was killed, his body was brought to his own
house, and lay in state, as it is called; that is, for exhibition, in a hall,
the walls of which were hung with crimson velvet bordered with
pearls.
But in all other respects, the houses, and even the king’s palaces,
were very deficient in what we should call furniture. Excepting one
or two arm-chairs for the heads of the family, the rooms usually
contained one coarse long table, some stools, a few benches, and
several chests, which also served for seats.
Those who could not afford the expense of hangings of silk, or
damask, or satin, covered the walls with gilt leather, or had them
panelled with wood. I think the last was the most appropriate, from
the description we have of what was perhaps the only parlor and
sitting-room of a French chateau, or country house.
“The hall was very large. At one end was a stag’s antlers, which
were used for hanging up hats, coats, dogs’ collars, and the chaplet
of paternosters. At the opposite end of the hall were bows and
arrows, targets, swords, pikes and cross-bows.
“In the great window were three harquebusses, (a kind of gun,)
with a variety of nets, and other apparatus for sporting. In the
chests (called coffers) were coats of mail laid up in bran, to keep
them from rusting. Under the benches was a plentiful supply of
clean straw for the dogs to lie on.”
Amidst all this litter, there were two shelves, on which was
deposited the library. This consisted of the Bible, Ogier the Dane, the
Shepherd’s Calendar, the Golden Legend, the Romance of the Rose,
&c.
From this selection, it would appear that romances were preferred
to those memoirs and histories, so much more interesting to us, of
which many had been written. The period itself produced several
writers, whose works are still held in high estimation.
At the head of these is the great Duke of Sully, who has given a
most interesting account of those scenes in French history, in which
he and his great master bore the most conspicuous part. Next to
him is De Thou, who has written a minute general history of the
period between 1545 and 1607.
Another distinguished memoir-writer was Theodore d’Aubigné,
half-brother to the king, and grandfather to Madame de Maintenon.
One of the first cares of Henry when he came to the throne, was
to restore his capital to its former flourishing condition. He found the
streets overgrown with grass, many of the shops shut up, and
others, abandoned by their owners, had been converted into stables.
When the Spanish ambassadors arrived, a few months after his
coronation, they expressed their admiration at the great
improvement which had taken place in the city, since it had been
under his rule.
The king replied, “When the master is absent, all things get into
disorder; but when he is returned, his presence ornaments the
house, and all things profit.”—Pictorial History of France.
The Last Leaf of Autumn.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.