100% found this document useful (4 votes)
410 views

Download How Linux Works 3rd Edition Brian Ward ebook All Chapters PDF

How

Uploaded by

nabilysippe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
410 views

Download How Linux Works 3rd Edition Brian Ward ebook All Chapters PDF

How

Uploaded by

nabilysippe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

How Linux Works 3rd Edition Brian Ward

https://textbookfull.com/product/how-linux-works-3rd-
edition-brian-ward/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

How Linux Works. What Every Superuser Should Know 3rd


Edition Brian Ward

https://textbookfull.com/product/how-linux-works-what-every-superuser-
should-know-3rd-edition-brian-ward/

textboxfull.com

How Linux Works What Every Superuser Should Know 3rd


Edition Brian Ward

https://textbookfull.com/product/how-linux-works-what-every-superuser-
should-know-3rd-edition-brian-ward-2/

textboxfull.com

How Linux Works What Every Superuser Should Know Brian


Ward

https://textbookfull.com/product/how-linux-works-what-every-superuser-
should-know-brian-ward/

textboxfull.com

Biology How Life Works 3rd Edition James Morris

https://textbookfull.com/product/biology-how-life-works-3rd-edition-
james-morris/

textboxfull.com
Biology How Life Works 3rd Edition Macmillan Higher
Education

https://textbookfull.com/product/biology-how-life-works-3rd-edition-
macmillan-higher-education/

textboxfull.com

Environmental Hydrology 3rd Edition Andy D. Ward

https://textbookfull.com/product/environmental-hydrology-3rd-edition-
andy-d-ward/

textboxfull.com

How Money Works Dk

https://textbookfull.com/product/how-money-works-dk/

textboxfull.com

How Psychology Works Dk

https://textbookfull.com/product/how-psychology-works-dk/

textboxfull.com

How Space Works 1st Edition Dk

https://textbookfull.com/product/how-space-works-1st-edition-dk/

textboxfull.com
CONTENTS IN DETAIL

REVIEWS FOR HOW LINUX WORKS

TITLE PAGE

COPYRIGHT

ABOUT THE AUTHOR

ACKNOWLEDGMENTS

PREFACE
Who Should Read This Book?
Prerequisites
How to Read This Book
A Hands-on Approach
How This Book Is Organized
What’s New in the Third Edition?
A Note on Terminology

CHAPTER 1: THE BIG PICTURE


1.1 Levels and Layers of Abstraction in a Linux System
1.2 Hardware: Understanding Main Memory
1.3 The Kernel
1.3.1 Process Management
1.3.2 Memory Management
1.3.3 Device Drivers and Management
1.3.4 System Calls and Support
1.4 User Space
1.5 Users
1.6 Looking Forward

CHAPTER 2: BASIC COMMANDS AND DIRECTORY


HIERARCHY
2.1 The Bourne Shell: /bin/sh
2.2 Using the Shell
2.2.1 The Shell Window
2.2.2 cat
2.2.3 Standard Input and Standard Output
2.3 Basic Commands
2.3.1 ls
2.3.2 cp
2.3.3 mv
2.3.4 touch
2.3.5 rm
2.3.6 echo
2.4 Navigating Directories
2.4.1 cd
2.4.2 mkdir
2.4.3 rmdir
2.4.4 Shell Globbing (“Wildcards”)
2.5 Intermediate Commands
2.5.1 grep
2.5.2 less
2.5.3 pwd
2.5.4 diff
2.5.5 file
2.5.6 find and locate
2.5.7 head and tail
2.5.8 sort
2.6 Changing Your Password and Shell
2.7 Dot Files
2.8 Environment and Shell Variables
2.9 The Command Path
2.10 Special Characters
2.11 Command-Line Editing
2.12 Text Editors
2.13 Getting Online Help
2.14 Shell Input and Output
2.14.1 Standard Error
2.14.2 Standard Input Redirection
2.15 Understanding Error Messages
2.15.1 Anatomy of a Unix Error Message
2.15.2 Common Errors
2.16 Listing and Manipulating Processes
2.16.1 ps Command Options
2.16.2 Process Termination
2.16.3 Job Control
2.16.4 Background Processes
2.17 File Modes and Permissions
2.17.1 Modifying Permissions
2.17.2 Working with Symbolic Links
2.18 Archiving and Compressing Files
2.18.1 gzip
2.18.2 tar
2.18.3 Compressed Archives (.tar.gz)
2.18.4 zcat
2.18.5 Other Compression Utilities
2.19 Linux Directory Hierarchy Essentials
2.19.1 Other Root Subdirectories
2.19.2 The /usr Directory
2.19.3 Kernel Location
2.20 Running Commands as the Superuser
2.20.1 sudo
2.20.2 /etc/sudoers
2.20.3 sudo Logs
2.21 Looking Forward

CHAPTER 3: DEVICES
3.1 Device Files
3.2 The sysfs Device Path
3.3 dd and Devices
3.4 Device Name Summary
3.4.1 Hard Disks: /dev/sd*
3.4.2 Virtual Disks: /dev/xvd*, /dev/vd*
3.4.3 Non-Volatile Memory Devices: /dev/nvme*
3.4.4 Device Mapper: /dev/dm-*, /dev/mapper/*
3.4.5 CD and DVD Drives: /dev/sr*
3.4.6 PATA Hard Disks: /dev/hd*
3.4.7 Terminals: /dev/tty*, /dev/pts/*, and /dev/tty
3.4.8 Serial Ports: /dev/ttyS*, /dev/ttyUSB*, /dev/ttyACM*
3.4.9 Parallel Ports: /dev/lp0 and /dev/lp1
3.4.10 Audio Devices: /dev/snd/*, /dev/dsp, /dev/audio,
and More
3.4.11 Device File Creation
3.5 udev
3.5.1 devtmpfs
3.5.2 udevd Operation and Configuration
3.5.3 udevadm
3.5.4 Device Monitoring
3.6 In-Depth: SCSI and the Linux Kernel
3.6.1 USB Storage and SCSI
3.6.2 SCSI and ATA
3.6.3 Generic SCSI Devices
3.6.4 Multiple Access Methods for a Single Device

CHAPTER 4: DISKS AND FILESYSTEMS


4.1 Partitioning Disk Devices
4.1.1 Viewing a Partition Table
4.1.2 Modifying Partition Tables
4.1.3 Creating a Partition Table
4.1.4 Navigating Disk and Partition Geometry
4.1.5 Reading from Solid-State Disks
4.2 Filesystems
4.2.1 Filesystem Types
4.2.2 Creating a Filesystem
4.2.3 Mounting a Filesystem
4.2.4 Filesystem UUID
4.2.5 Disk Buffering, Caching, and Filesystems
4.2.6 Filesystem Mount Options
4.2.7 Remounting a Filesystem
4.2.8 The /etc/fstab Filesystem Table
4.2.9 Alternatives to /etc/fstab
4.2.10 Filesystem Capacity
4.2.11 Checking and Repairing Filesystems
4.2.12 Special-Purpose Filesystems
4.3 Swap Space
4.3.1 Using a Disk Partition as Swap Space
4.3.2 Using a File as Swap Space
4.3.3 Determining How Much Swap You Need
4.4 The Logical Volume Manager
4.4.2 Working with LVM
4.4.3 The LVM Implementation
4.5 Looking Forward: Disks and User Space
4.6 Inside a Traditional Filesystem
4.6.1 Inode Details and the Link Count
4.6.2 Block Allocation
4.6.3 Working with Filesystems in User Space

CHAPTER 5: HOW THE LINUX KERNEL BOOTS


5.1 Startup Messages
5.2 Kernel Initialization and Boot Options
5.3 Kernel Parameters
5.4 Boot Loaders
5.4.1 Boot Loader Tasks
5.4.2 Boot Loader Overview
5.5.1 Exploring Devices and Partitions with the GRUB
Command Line
5.5.2 GRUB Configuration
5.5.3 GRUB Installation
5.6 UEFI Secure Boot Problems
5.7 Chainloading Other Operating Systems
5.8 Boot Loader Details
5.8.1 MBR Boot
5.8.2 UEFI Boot
5.8.3 How GRUB Works
CHAPTER 6: HOW USER SPACE STARTS
6.2 Identifying Your init
6.3 systemd
6.3.1 Units and Unit Types
6.3.2 Booting and Unit Dependency Graphs
6.3.3 systemd Configuration
6.3.4 systemd Operation
6.3.5 systemd Process Tracking and Synchronization
6.3.6 systemd Dependencies
6.3.7 systemd On-Demand and Resource-Parallelized
Startup
6.3.8 systemd Auxiliary Components
6.4 System V Runlevels
6.5 System V init
6.5.1 System V init: Startup Command Sequence
6.5.2 The System V init Link Farm
6.5.3 run-parts
6.5.4 System V init Control
6.5.5 systemd System V Compatibility
6.6 Shutting Down Your System
6.7 The Initial RAM Filesystem
6.8 Emergency Booting and Single-User Mode
6.9 Looking Forward

CHAPTER 7: SYSTEM CONFIGURATION: LOGGING,


SYSTEM TIME, BATCH JOBS, AND USERS
7.1 System Logging
7.1.1 Checking Your Log Setup
7.1.2 Searching and Monitoring Logs
7.1.3 Logfile Rotation
7.1.4 Journal Maintenance
7.1.5 A Closer Look at System Logging
7.2 The Structure of /etc
7.3 User Management Files
7.3.1 The /etc/passwd File
7.3.2 Special Users
7.3.3 The /etc/shadow File
7.3.4 Manipulating Users and Passwords
7.3.5 Working with Groups
7.4 getty and login
7.5 Setting the Time
7.5.1 Kernel Time Representation and Time Zones
7.5.2 Network Time
7.6 Scheduling Recurring Tasks with cron and Timer Units
7.6.1 Installing Crontab Files
7.6.2 System Crontab Files
7.6.3 Timer Units
7.6.4 cron vs. Timer Units
7.7 Scheduling One-Time Tasks with at
7.7.1 Timer Unit Equivalents
7.8 Timer Units Running as Regular Users
7.9 User Access Topics
7.9.1 User IDs and User Switching
7.9.2 Process Ownership, Effective UID, Real UID, and
Saved UID
7.9.3 User Identification, Authentication, and Authorization
7.9.4 Using Libraries for User Information
7.10 Pluggable Authentication Modules
7.10.1 PAM Configuration
7.10.2 Tips on PAM Configuration Syntax
7.10.3 PAM and Passwords
7.11 Looking Forward

CHAPTER 8: A CLOSER LOOK AT PROCESSES AND


RESOURCE UTILIZATION
8.1 Tracking Processes
8.2 Finding Open Files with lsof
8.2.1 Reading the lsof Output
8.2.2 Using lsof
8.3 Tracing Program Execution and System Calls
8.3.1 strace
8.3.2 ltrace
8.4 Threads
8.4.1 Single-Threaded and Multithreaded Processes
8.4.2 Viewing Threads
8.5.1 Measuring CPU Time
8.5.2 Adjusting Process Priorities
8.5.3 Measuring CPU Performance with Load Averages
8.5.4 Monitoring Memory Status
8.5.5 Monitoring CPU and Memory Performance with
vmstat
8.5.6 I/O Monitoring
8.5.7 Per-Process Monitoring with pidstat
8.6 Control Groups (cgroups)
8.6.1 Differentiating Between cgroup Versions
8.6.2 Viewing cgroups
8.6.3 Manipulating and Creating cgroups
8.6.4 Viewing Resource Utilization
8.7 Further Topics
CHAPTER 9: UNDERSTANDING YOUR NETWORK AND ITS
CONFIGURATION
9.1 Network Basics
9.2 Packets
9.3 Network Layers
9.4 The Internet Layer
9.4.1 Viewing IP Addresses
9.4.2 Subnets
9.4.3 Common Subnet Masks and CIDR Notation
9.5 Routes and the Kernel Routing Table
9.6 The Default Gateway
9.7 IPv6 Addresses and Networks
9.7.1 Viewing IPv6 Configuration on Your System
9.7.2 Configuring Dual-Stack Networks
9.8 Basic ICMP and DNS Tools
9.8.1 ping
9.8.2 DNS and host
9.9 The Physical Layer and Ethernet
9.10 Understanding Kernel Network Interfaces
9.11.1 Manually Configuring Interfaces
9.11.2 Manually Adding and Deleting Routes
9.12 Boot-Activated Network Configuration
9.13 Problems with Manual and Boot-Activated Network
Configuration
9.14 Network Configuration Managers
9.14.1 NetworkManager Operation
9.14.2 NetworkManager Interaction
9.14.3 NetworkManager Configuration
9.15 Resolving Hostnames
9.15.1 /etc/hosts
9.15.2 resolv.conf
9.15.3 Caching and Zero-Configuration DNS
9.15.4 /etc/nsswitch.conf
9.16 Localhost
9.17 The Transport Layer: TCP, UDP, and Services
9.17.1 TCP Ports and Connections
9.17.2 UDP
9.18 Revisiting a Simple Local Network
9.19 Understanding DHCP
9.19.1 Linux DHCP Clients
9.19.2 Linux DHCP Servers
9.20 Automatic IPv6 Network Configuration
9.21 Configuring Linux as a Router
9.22 Private Networks (IPv4)
9.23 Network Address Translation (IP Masquerading)
9.24 Routers and Linux
9.25 Firewalls
9.25.1 Linux Firewall Basics
9.25.2 Setting Firewall Rules
9.25.3 Firewall Strategies
9.26 Ethernet, IP, ARP, and NDP
9.27 Wireless Ethernet
9.27.1 iw
9.27.2 Wireless Security
9.28 Summary

CHAPTER 10: NETWORK APPLICATIONS AND SERVICES


10.1 The Basics of Services
10.2 A Closer Look
10.3 Network Servers
10.3.1 Secure Shell
10.3.2 The sshd Server
10.3.3 fail2ban
10.3.4 The SSH Client
10.4 Pre-systemd Network Connection Servers: inetd/xinetd
10.5 Diagnostic Tools
10.5.1 lsof
10.5.2 tcpdump
10.5.3 netcat
10.5.4 Port Scanning
10.6 Remote Procedure Calls
10.7 Network Security
10.7.1 Typical Vulnerabilities
10.7.2 Security Resources
10.8 Looking Forward
10.9 Network Sockets
10.10 Unix Domain Sockets

CHAPTER 11: INTRODUCTION TO SHELL SCRIPTS


11.1 Shell Script Basics
11.1.1 Limitations of Shell Scripts
11.2 Quoting and Literals
11.2.1 Literals
11.2.2 Single Quotes
11.2.3 Double Quotes
11.2.4 Literal Single Quotes
11.3 Special Variables
11.3.1 Individual Arguments: $1, $2, and So On
11.3.2 Number of Arguments: $#
11.3.3 All Arguments: $@
11.3.4 Script Name: $0
11.3.5 Process ID: $$
11.3.6 Exit Code: $?
11.4 Exit Codes
11.5 Conditionals
11.5.1 A Workaround for Empty Parameter Lists
11.5.2 Other Commands for Tests
11.5.3 elif
11.5.4 Logical Constructs
11.5.5 Testing Conditions
11.5.6 case
11.6 Loops
11.6.1 for Loops
11.6.2 while Loops
11.7 Command Substitution
11.8 Temporary File Management
11.9 Here Documents
11.10 Important Shell Script Utilities
11.10.1 basename
11.10.2 awk
11.10.3 sed
11.10.4 xargs
11.10.5 expr
11.10.6 exec
11.11 Subshells
11.12 Including Other Files in Scripts
11.13 Reading User Input
11.14 When (Not) to Use Shell Scripts

CHAPTER 12: NETWORK FILE TRANSFER AND SHARING


12.1 Quick Copy
12.2 rsync
12.2.1 Getting Started with rsync
12.2.2 Making Exact Copies of a Directory Structure
12.2.3 Using the Trailing Slash
12.2.4 Excluding Files and Directories
12.2.5 Checking Transfers, Adding Safeguards, and
Using Verbose Mode
12.2.6 Compressing Data
12.2.7 Limiting Bandwidth
12.2.8 Transferring Files to Your Computer
12.2.9 Further rsync Topics
12.3.1 File Sharing Usage and Performance
12.3.2 File Sharing Security
12.4 Sharing Files with Samba
12.4.1 Server Configuration
12.4.2 Server Access Control
12.4.3 Passwords
12.4.4 Manual Server Startup
12.4.5 Diagnostics and Logfiles
12.4.6 File Share Configuration
12.4.7 Home Directories
12.4.8 Printer Sharing
12.4.9 The Samba Client
12.5 SSHFS
12.6 NFS
12.7 Cloud Storage
12.8 The State of Network File Sharing

CHAPTER 13: USER ENVIRONMENTS


13.1 Guidelines for Creating Startup Files
13.2 When to Alter Startup Files
13.3 Shell Startup File Elements
13.3.1 The Command Path
13.3.2 The Manual Page Path
13.3.3 The Prompt
13.3.4 Aliases
13.3.5 The Permissions Mask
13.4 Startup File Order and Examples
13.4.1 The bash Shell
13.4.2 The tcsh Shell
13.5 Default User Settings
13.5.1 Shell Defaults
13.5.2 Editor
13.5.3 Pager
13.6 Startup File Pitfalls
13.7 Further Startup Topics

CHAPTER 14: A BRIEF SURVEY OF THE LINUX DESKTOP


AND PRINTING
14.1 Desktop Components
14.1.1 Framebuffers
14.1.2 The X Window System
14.1.3 Wayland
14.1.4 Window Managers
14.1.5 Toolkits
14.1.6 Desktop Environments
14.1.7 Applications
14.2 Are You Running Wayland or X?
14.3 A Closer Look at Wayland
14.3.1 The Compositing Window Manager
14.3.2 libinput
14.3.3 X Compatibility in Wayland
14.4 A Closer Look at the X Window System
14.4.1 Display Managers
14.4.2 Network Transparency
14.4.3 Ways of Exploring X Clients
14.4.4 X Events
14.4.5 X Input and Preference Settings
14.5 D-Bus
14.5.1 System and Session Instances
14.5.2 D-Bus Message Monitoring
14.6 Printing
14.6.1 CUPS
14.6.2 Format Conversion and Print Filters
14.7 Other Desktop Topics

CHAPTER 15: DEVELOPMENT TOOLS


15.1 The C Compiler
15.1.1 Compiling Multiple Source Files
15.1.2 Linking with Libraries
15.1.3 Working with Shared Libraries
15.1.4 Working with Header (Include) Files and
Directories
15.2 make
15.2.1 A Sample Makefile
15.2.2 Built-in Rules
15.2.3 Final Program Build
15.2.4 Dependency Updates
15.2.5 Command-Line Arguments and Options
15.2.6 Standard Macros and Variables
15.2.7 Conventional Targets
15.2.8 Makefile Organization
15.3 Lex and Yacc
15.4 Scripting Languages
15.4.1 Python
15.4.2 Perl
15.4.3 Other Scripting Languages
15.5 Java
15.6 Looking Forward: Compiling Packages

CHAPTER 16: INTRODUCTION TO COMPILING SOFTWARE


FROM C SOURCE CODE
16.1 Software Build Systems
16.2 Unpacking C Source Packages
16.3 GNU Autoconf
16.3.1 An Autoconf Example
16.3.2 Installation Using a Packaging Tool
16.3.3 configure Script Options
16.3.4 Environment Variables
16.3.5 Autoconf Targets
16.3.6 Autoconf Logfiles
16.3.7 pkg-config
16.4 Installation Practice
16.4.1 Where to Install
16.5 Applying a Patch
16.6 Troubleshooting Compiles and Installations
16.6.1 Specific Errors
16.7 Looking Forward
CHAPTER 17: VIRTUALIZATION
17.1 Virtual Machines
17.1.1 Hypervisors
17.1.2 Hardware in a Virtual Machine
17.1.3 Common Uses of Virtual Machines
17.1.4 Drawbacks of Virtual Machines
17.2 Containers
17.2.1 Docker, Podman, and Privileges
17.2.2 A Docker Example
17.2.3 LXC
17.2.4 Kubernetes
17.2.5 Pitfalls of Containers
17.3 Runtime-Based Virtualization

INDEX
Reviews for How Linux Works

“If you are interested in Linux, How Linux


Works: What Every Superuser Should Know is a
must-read title.”
—L I

“Lots to offer on almost every aspect of the Linux


architecture.”
—E L U

“You’ll get an essential understanding of what’s


going on under the hood without getting bogged
down in minutiae—making this a very refreshing
(and wholly recommended) addition to the Linux
literature.”
—P B , - U M E
U

“Dives straight into the transparent depths of


Linux-based operating systems and shows us how
all the pieces fit together.”
—D W

“Earns its place on the shelf as an essential


reference.”
—T M P
HOW LINUX WORKS
3rd Edition

What Every Superuser Should Know

by Brian Ward

San Francisco
How Linux Works, 3rd Edition. Copyright © 2021 by Brian Ward.
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.
Publisher: William Pollock
Executive Editor: Barbara Yien
Production Editor: Rachel Monaghan
Developmental Editors: Larry Wake and Jill Franklin
Cover and Interior Design: Octopod Studios
Technical Reviewers: Jordi Gutiérrez Hermoso and Petros Koutoupis
Copyeditor: Rachel Monaghan
Compositor: Cody Gates, Happenstance Type-O-Rama
Proofreader: James M. Fraleigh
For information on book distributors or translations, 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 has catalogued the first edition as follows:

Ward, Brian.
How Linux works : what every superuser should know / Brian Ward.
p. cm.
Includes index.
ISBN 1-59327-035-6
1. Linux. 2. Operating systems (Computers). I. Title.
QA76.76.O63 W3654 2004
005.4’32--dc22
2004002692

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.
About the Author
Brian Ward has been working with Linux since 1993. He is also the
author of The Linux Kernel HOWTO, The Book of VMware (No
Starch Press), and The Linux Problem Solver (No Starch Press).

About the Technical Reviewers


Jordi Gutiérrez Hermoso is a GNU/Linux user and developer
with almost two decades of experience, with occasional contributions
in various circles of the free software communities, such as GNU
Octave and Mercurial. His professional work has allowed him to
collaborate with and learn about diverse topics such as digital
cryptographic signatures, medical imaging, and most recently
greenhouse gas accounting and ecological map data, all built entirely
with Linux and other free software. When he is not near a computer
he enjoys swimming, mathematics, and knitting.
Petros Koutoupis is currently a senior performance software
engineer at HPE (formerly Cray Inc.) for its Lustre High
Performance File System division. He is also the creator and
maintainer of the RapidDisk Project (www.rapiddisk.org). Petros
has worked in the data storage industry for well over a decade and
has helped pioneer the many technologies unleashed in the wild
today.
ACKNOWLEDGMENTS

Contributions to this book come from not just those who were
involved in the development process, but also those without whom I
wouldn’t know anything about Linux. These include James Duncan,
Douglas N. Arnold, Bill Fenner, Ken Hornstein, Scott Dickson, Dan
Ehrlich, Felix Lee, and Gregory P. Smith. Previous editions included
help from Karol Jurado, Laurel Chun, Serena Yang, Alison Law, Ri-
ley Hoffman, Scott Schwartz, Dan Sully, Dominique Poulain, Donald
Karon, and Gina Steele.
This third edition benefits from the excellent work of Barbara
Yien, Rachel Monaghan, Jill Franklin, Larry Wake, Jordi Gutiérrez
Hermoso, and Petros Koutoupis. As the publisher of No Starch Press,
Bill Pollock has been instrumental in this book since the first edition.
And once more, Hsinju Hsieh has put up with me for another revi-
sion.
PREFACE

Your system shouldn’t be a mystery. You should be able to make your


software do what you want it to do without “magic” incantations or
rituals. The key to attaining this power lies in understanding the
fundamentals of what the software does and how it works, and that’s
what this book is all about. You should never have to fight with a
computer.
Linux is a great platform for learning because it doesn’t try to hide
anything from you. In particular, you can find most system
configuration details in easy-to-read plaintext files. The only tricky
part is figuring out which parts are responsible for what and how
they all fit together.

Who Should Read This Book?


Your interest in learning how Linux works may have come from any
number of sources. In the professional realm, operations and
DevOps folks need to know nearly everything that you’ll find in this
book. Linux software architects and developers should also know this
material in order to make the best use of the operating system.
Researchers and students, often running their own Linux systems,
will also find that this book provides useful explanations for why
things are set up the way they are.
Then there are the tinkerers—people who just love to play around
with their computers for fun, profit, or both. Want to know why
certain things work while others don’t? Want to know what happens
if you move something around? You’re probably a tinkerer.

Prerequisites
Although Linux is beloved by programmers, you don’t need to be a
programmer to read this book; you need only basic computer-user
knowledge. That is, you should be able to bumble around a GUI
(especially the installer and settings interface for a Linux
distribution) and know what files and directories (folders) are. You
should also be prepared to check additional documentation on your
system and on the web. The most important thing you need is to be
ready and willing to play around with your computer.

How to Read This Book


Building the requisite knowledge is a challenge in tackling any
technical subject. Explaining how software systems work can get
really complicated. Too much detail can bog down readers and make
important concepts difficult to grasp (the human brain just can’t
process so many new ideas at once), but too little detail can leave
readers in the dark and unprepared for later material.
I’ve designed most chapters to tackle the most important material
first: the basic information that you’ll need in order to progress. In
places, I’ve simplified things in order to keep focus. As a chapter
progresses, you’ll see much more detail, especially in the last few
sections. Do you need to know those bits right away? In most cases,
no; I note this where applicable. If your eyes start to glaze over when
you’re faced with a lot of extra details about concepts you just
learned, don’t hesitate to skip ahead to the next chapter or take a
break. The nitty-gritty will still be there waiting for you.

A Hands-on Approach
However you choose to proceed through this book, you should have a
Linux machine in front of you, preferably one that you’re confident
abusing with experiments. You might prefer to play around with a
virtual installation—I used VirtualBox to test much of the material in
this book. You also should have superuser (root) access, but try to
use a regular user account most of the time. You’ll mostly work at the
command line, in a terminal window or a remote session. If you
haven’t worked much in that environment, no problem; Chapter 2
will bring you up to speed.
Commands in this book typically look like this:

$ ls /
[some output]

Enter the text in bold; the nonbolded text that follows is what the
machine spits back. The $ is the prompt for a regular user account. If
you see a # as a prompt, you need to be superuser. (More on that in
Chapter 2.)
How This Book Is Organized
I’ve grouped the book’s chapters into three basic parts. The first is
introductory, giving a bird’s-eye view of the system and then offering
hands-on experience with some tools you’ll need for as long as you
run Linux. Next, you’ll explore each part of the system in more detail,
from device management to network configuration, following the
general order in which the system starts. Finally, you’ll get a tour of
some pieces of a running system, learn some essential skills, and get
some insight into the tools that programmers use.
With the exception of Chapter 2, most of the early chapters heavily
involve the Linux kernel, but you’ll work your way into user space as
the book progresses. (If you don’t know what I’m talking about here,
don’t worry; I’ll explain in Chapter 1.)
The material is meant to be as distribution-agnostic as possible.
Having said this, it can be tedious to cover all variations in systems
software, so I’ve tried to cover the two major distribution families:
Debian (including Ubuntu) and RHEL/Fedora/CentOS. I’ve also
focused on desktop and server installations. A significant amount of
material carries over into embedded systems, such as Android and
OpenWRT, but it’s up to you to discover the differences on those
platforms.

What’s New in the Third Edition?


The second edition was published during a time of transition for
Linux systems. Several traditional components were in the process of
being replaced, which made handling some subjects tricky, because
readers could encounter a wide variety of configurations. Now,
however, those new pieces (systemd in particular) have near-
universal adoption, so I’ve been able to streamline a fair amount of
the discussion.
I’ve retained the emphasis on the kernel’s role in a Linux system.
This material has proven popular, and you probably interact with the
kernel more than you realize.
I’ve added a new chapter introducing virtualization. Although
Linux has always been popular on virtual machines (such as cloud
services), that type of virtualization lies outside the scope of this
book, because the way the system operates on a virtual machine is
almost the same as on “bare metal” hardware. So, the discussion here
primarily focuses on deciphering the terminology you’ll encounter.
However, containers have gained in popularity since the second
edition was published, and they also fit here, because they basically
consist of a bunch of Linux features like the ones described
throughout the rest of the book. Containers make heavy use of
cgroups, which also get new treatment in this third edition.
Other subjects (not necessarily related to containers) I happily
expanded on are the Logical Volume Manager, the journald logging
system, and IPv6 in the networking material.
Though I’ve added a significant amount of content, the book is still
a reasonable size. I want to provide the information you need to get
on the fast track, and that includes explaining certain details along
the way that can be hard to grasp, but I don’t want you to have to
become a weightlifter in order to pick up this book. Once you master
the important subjects here, you should have no trouble seeking out
and understanding more details.
The first edition included historical information that I removed
later to improve focus. If you’re interested in Linux and how it relates
to the history of Unix, pick up Peter H. Salus’s The Daemon, the Gnu,
and the Penguin (Reed Media Services, 2008). It does a great job of
explaining how the software we use has evolved over time.

A Note on Terminology
The names of certain operating system elements have caused a fair
amount of debate historically—even the word Linux itself. Should it
be “Linux,” or should it be “GNU/Linux” to reflect that the operating
system also contains pieces from the GNU Project? Throughout this
book, I’ve tried to use the most common, least awkward names
possible.
Random documents with unrelated
content Scribd suggests to you:
The best part of the kangaroo is its tail. Talk of ox-tail soup, ye
metropolitan gourmands! Commend us to the superb kangaroo-tail
soup of Australia, made from the tail weighing some 10 or 12 lbs., if
a full-grown forester.
The pademelon, a smaller species of kangaroo, weighs about 9 or
10 lbs., and when cooked like a hare, affords a dish with which the
most fastidious gourmand might be satisfied.
The following is the native mode of cooking a kangaroo steak:—It is
placed in a scooped out stone, which is readily found in the streams,
and pressed down by heavy stones on the top of it; the heat is
applied beneath and round the first top stone; at the critical moment
the stones are quickly removed, and the steak appears in its most
savoury state.
The aborigines of Australia always roast their food; they have no
means of boiling, except when they procure the service of an old
European saucepan or tin pot. ‘It is a very remarkable fact’ (remarks
Mr. Moore) ‘in the history of mankind, that a people should be found
now to exist, without any means of heating water, or cooking liquid
food; or, in short, without any culinary utensil or device of any sort.
The only mode of cooking was to put the food into the fire, or roast it
in the embers or hot ashes; small fish or frogs being sometimes first
wrapped in a piece of paper-tree bark. Such was their state when
Europeans first came among them. They are now extremely fond of
soup and tea.’
A native will not eat tainted meat, although he cannot be said to be
very nice in his food, according to our ideas. Their meat is cooked
almost as soon as killed, and eaten immediately.
The parts of the kangaroo most esteemed for eating are the loins
and the tail, which abound in gelatine, and furnish an excellent and
nourishing soup; the hind legs are coarse, and usually fall to the
share of the dogs. The natives (if they can be said to have a choice)
give a preference to the head. The flesh of the full-grown animal may
be compared to lean beef, and that of the young to veal; they are
destitute of fat, if we except a little being occasionally seen between
the muscles and integuments of the tail. The colonial dish, called a
steamer, consists of the flesh of the animal dressed, with slices of
ham. The liver when cooked is crisp and dry, and is considered a
substitute for bread; but I cannot coincide in this opinion.
The goto, or long bag of kangaroo skin, about two feet deep, and a
foot and a half broad, carried by the native females in Australia, is
the common receptacle for every small article which the wife or
husband may require or take a fancy to, whatever its nature or
condition may be. Fish just caught, or dry bread, frogs, roots, and
clay, are all mingled together.
Mr. George Bennett (Wanderings in New South Wales) thus speaks
of Australian native cookery:—
‘After wet weather they track game with much facility; and from the
late rains the hunting expeditions had been very successful; game
was, therefore, very abundant at the camp, which consisted of
opossums, flying squirrels, bandicoots, snakes, &c.
‘One of the opossums among the game was a female, which had
two large-sized young ones in her pouch; these delicate morsels
were at this time broiling, unskinned and undrawn, upon the fire,
whilst the old mother was lying yet unflayed in the basket.
‘It was amusing to see with what rapidity and expertness the animals
were skinned and embowelled by the blacks. The offal was thrown to
the dogs; but, as such a waste on the part of the natives does not
often take place, we can only presume it is when game, as it was at
present, is very abundant. The dogs are usually in poor condition,
from getting a very precarious supply of provender. The liver being
extracted, and gall-bladder removed, a stick was thrust through the
animal, which was either thrown upon the ashes to broil, or placed
upon a wooden spit before the fire to roast. Whether the food was
removed from the fire cooked, or only half dressed, depended
entirely on the state of their appetites. The flesh of the animals at this
time preparing for dinner, by our tawny friends, appeared delicate,
and was no doubt excellent eating, as the diet of the animals was in
most instances vegetable.’
Another traveller in the Bush thus describes the aboriginal practices
and food:—‘We had scarcely finished the snake, when Tomboor-
rowa and little Sydney returned again. They had been more
successful this time, having shot two wallabies or brush kangaroos
and another carpet-snake of six feet in length. A bundle of rotten
branches was instantly gathered and thrown upon the expiring
embers of our former fire, and both the wallabies and the snake were
thrown into the flame. One of the wallabies had been a female, and
as it lay dead on the grass, a young one, four or five inches long,
crept out of its pouch. I took up the little creature, and, presenting it
to the pouch, it crept in again. Having turned round, however, for a
minute or two, Gnunnumbah had taken it up and thrown it alive into
the fire; for, when I happened to look towards the fire, I saw it in the
flames in the agony of death. In a minute or two the young wallaby
being sufficiently done, Gnunnumbah drew it out of the fire with a
stick, and eat its hind-quarters without further preparation, throwing
the rest of it away.
‘It is the etiquette among the black natives for the person who takes
the game to conduct the cooking of it. As soon, therefore, as the
skins of the wallabies had become stiff and distended from the
expansion of the gases in the cavity of their bodies, Tomboor-rowa
and Sydney each pulled one of them from the fire, and scraping off
the singed hair roughly with the hand, cut up the belly and pulled out
the entrails. They then cleaned out the entrails, not very carefully by
any means, rubbing them roughly on the grass or on the bushes,
and then threw them again upon the fire. When they considered
them sufficiently done, the two eat them, a considerable quantity of
their original contents remaining to serve as a sort of condiment or
sauce. The tails and lower limbs of the two wallabies, when the latter
were supposed to be done enough, were twisted off and eaten by
the other two natives (from one of whom I got one of the vertebræ of
the tail and found it delicious); the rest of the carcases, with the large
snake, being packed up in a number of the Sydney Herald, to serve
as a mess for the whole camp at Brisbane. The black fellows were
evidently quite delighted with the excursion; and, on our return to the
Settlement, they asked Mr. Wade if he was not going again to-
morrow.’
The kangaroo rat, an animal nearly as large as a wild rabbit, is
tolerably abundant, and very good eating, when cooked in the same
manner. The natives take them by driving a spear into the nest,
sometimes transfixing two at once, or by jumping upon the nest,
which is formed of leaves and grass upon the ground.
It is less sought for than its larger relatives, except by thorough
bushmen, owing to the prejudice excited by the unfortunate name
which has been bestowed upon it. Those who have once tried it
usually become fond of it; and to the sawyers and splitters these
animals yield many a fresh meal, during their sojourn amidst the
heavily timbered flats and ranges of Victoria and New South Wales.
The animal is not of the rat species, but a perfect kangaroo in
miniature.
The flesh of the phalangers is of delicate flavor. The large grey
opossum (Phalangista vulpina) forms a great resource for food to the
natives of Australia, who climb the tallest trees in search of them,
and take them from the hollow branches. The flesh is very good,
though not much used by the settlers, the carcase being thrown to
the dogs, while the sportsman contents himself with the skin.
The common opossum (Didelphys Virginiana) is eaten in some of
the states and territories of America; it is very much like a large rat,
and is classed among the ‘vermin’ by the Americans. Their flesh is,
however, white and well-tasted; but their ugly tail puts one out of
conceit with the fare.
The wombat, a bear-like marsupial quadruped of Australia, (the
Phascolomys wombat,) is eaten in New South Wales and other parts
of the Australian Continent. In size it often equals a sheep, some of
the largest weighing 140 lbs.; and the flesh is said by some to be not
unlike venison, and by others to resemble lean mutton. As it is of
such considerable size, attaining the length of three feet, it has been
suggested that it might be worth naturalizing here.

RODENTIA.
Passing now to the rodents or gnawing animals, we find that the
large grey squirrel (Sciurus cinereus, Desm.) is very good eating.
The flesh of the squirrel is much valued by the Dyaks, and it will,
doubtless, hereafter be prized for the table of Europeans.
The marmot (Arctomys Marmotta), in its fat state, when it first retires
to its winter quarters, is in very good condition, and is then killed and
eaten in great numbers, although we may affect to despise it.
The mouse, to the Esquimaux epicures, is a real bonne bouche, and
if they can catch half-a-dozen at a time, they run a piece of horn or
twig through them, in the same manner as the London poulterers
prepare larks for the table; and without stopping to skin them, or
divest them of their entrails, broil them over the fire; and although
some of the mice may have belonged to the aborigines of the race,
yet so strong is the mastication of the natives, that the bones of the
animal yield to its power as easily as the bones of a rabbit would to a
shark.
There is a very large species of rat spoken of as found in the island
of Martinique, nearly four times the size of the ordinary rat. It is black
on the back, with a white belly, and is called, locally, the piloris or
musk rat, as it perfumes the air around. The inhabitants eat them;
but then they are obliged, after they are skinned, to expose them a
whole night to the air; and they likewise throw away the first water
they are boiled in, because it smells so strongly of musk.
The flesh of the musk rat is not bad, except in rutting time, for then it
is impossible to deprive it of the musky smell and flavour.
So fat and sleek do the rats become in the West Indies, from feeding
on the sugar cane in the cane fields, that some of the negroes find
them an object of value, and, with the addition of peppers and similar
spiceries, prepare from them a delicate fricassée not to be
surpassed by a dish of French frogs.
There is a professional rat-catcher employed on each sugar
plantation, and he is paid so much a dozen for the tails he brings in
to the overseer. Father Labat tells us that he made his hunters bring
the whole rat to him, for if the heads or tails only came, the bodies
were eaten by the negroes, which he wished to prevent, as he
thought that this food brought on consumption! The health of the
negroes was then a matter of moment, considering the money value
at which they were estimated and sold. A rat hunt in a cane field
affords glorious sport. In cutting down the canes, one small patch is
reserved standing, into which all the rats congregate, and the
negroes, surrounding the preserve, with their clubs and bill-hooks
speedily despatch the rats, and many are soon skinned and cooked.
The negroes in Brazil, too, eat every rat which they can catch; and I
do not see why they should not be well-tasted and wholesome meat,
seeing that their food is entirely vegetable, and that they are clean,
sleek, and plump. The Australian aborigines eat mice and rats
whenever they can catch them.
Scinde is so infested with rats, that the price of grain has risen 25
per cent. from the destruction caused to the standing crops by them.
The government commissioner has recently issued a proclamation
granting head-money on all rats and mice killed in the province. The
rate is to be 3d. a dozen, the slayer having the privilege of keeping
the body and presenting the tail.
In China, rat soup is considered equal to ox-tail soup, and a dozen
fine rats will realize two dollars, or eight or nine shillings.
Besides the attractions of the gold-fields for the Chinese, California
is so abundantly supplied with rats, that they can live like Celestial
emperors, and pay very little for their board. The rats of California
exceed the rats of the older American States, just as nature on that
side of the continent exceeds in bountifulness of mineral wealth. The
California rats are incredibly large, highly flavoured, and very
abundant. The most refined Chinese in California have no hesitation
in publicly expressing their opinion of ‘them rats.’ Their professed
cooks, we are told, serve up rats’ brains in a much superior style to
the Roman dish of nightingales’ and peacocks’ tongues. The sauce
used is garlic, aromatic seeds, and camphor.
Chinese dishes and Chinese cooking have lately been popularly
described by the fluent pen of Mr. Wingrove Cooke, the Times’
correspondent in China, but he has by no means exhausted the
subject. Chinese eating saloons have been opened in California and
Australia, for the accommodation of the Celestials who now throng
the gold-diggings, despite the heavy poll-tax to which they have
been subjected.
Mr. Albert Smith, writing home from China, August 22, 1858, his first
impressions, says:—
‘The filth they eat in the eating houses far surpasses that cooked at
that old trattoria at Genoa. It consists for the most part of rats, bats,
snails, bad eggs, and hideous fish, dried in the most frightful
attitudes. Some of the restaurateurs carry their cook-shops about
with them on long poles, with the kitchen at one end, and the salle-à-
manger at the other. These are celebrated for a soup made, I should
think, from large caterpillars boiled in a thin gravy, with onions.’
The following is an extract from the bill of fare of one of the San
Francisco eating houses—
Grimalkin steaks 25 cents.
Bow-wow soup 12 ”
Roasted bow-wow 18 ”
Bow-wow pie 6 ”
Stews ratified 6 ”
The latter dish is rather dubious. What is meant by stews rat-ified?
Can it be another name for rat pie? Give us light, but no pie.
The San Francisco Whig furnishes the following description of a
Chinese feast in that city:—‘We were yesterday invited, with three
other gentlemen, to partake of a dinner à la Chinese. At three o’clock
we were waited upon by our hosts, Keychong, and his partner in
Sacramento-street, Peter Anderson, now a naturalized citizen of the
United States, and Acou, and escorted to the crack Chinese
restaurant in Dupont-street, called Hong-fo-la, where a circular table
was set out in fine style:—
‘Course No. 1.—Tea, hung-yos (burnt almonds), ton-kens (dry
ginger), sung-wos (preserved orange).
‘Course No 2.—Won-fo (a dish oblivious to us, and not mentioned in
the cookery-book).
‘No. 3.—Ton-song (ditto likewise).
‘No. 4.—Tap-fau (another quien sabe).
‘No. 5.—Ko-yo (a conglomerate of fish, flesh, and fowl).
‘No. 6.—Suei-chon (a species of fish ball).
‘Here a kind of liquor was introduced, served up in small cups,
holding about a thimbleful, which politeness required we should
empty between every course, first touching cups and salaaming.
‘No. 7.—Beche-le-mer (a dried sea-slug, resembling India rubber,
worth one dollar per pound).
‘No. 8—Moisum. (Have some?)
‘No. 9.—Su-Yum (small balls, as bills of lading remark, ‘contents
unknown’).
‘No. 10.—Hoisuigo (a kind of dried oyster).
‘No. 11.—Songhai (China lobster).
‘No. 12.—Chung-so (small ducks in oil).
‘No. 13.—Tong-chou (mushrooms, worth three dollars per pound).
‘No. 14.—Sum-yoi (birds’ nests, worth 60 dollars per pound).
‘And some ten or twelve more courses, consisting of stewed acorns,
chestnuts, sausages, dried ducks, stuffed oysters, shrimps,
periwinkles, and ending with tea—each course being served up with
small china bowls and plates, in the handiest and neatest manner;
and we have dined in many a crack restaurant, where it would be a
decided improvement to copy from our Chinese friends. The most
difficult feat for us was the handling of the chop sticks, which mode
of carrying to the mouth is a practical illustration of the old proverb,
‘many a slip ’twixt the cup and lip.’ We came away, after a three
hours’ sitting, fully convinced that a China dinner is a very costly and
elaborate affair, worthy the attention of epicures. From this time,
henceforth, we are in the field for China, against any insinuations on
the question of diet à la rat, which we pronounce a tale of untruth.
We beg leave to return thanks to our host, Keychong, for his elegant
entertainment, which one conversant with the Chinese bill of fare
informs us, must have cost over 100 dollars. Vive la China!’
Mr. Cooke, in his graphic letters from China, speaks of the fatness
and fertility of the rats of our colony of Hong Kong. He adds: ‘When
Minutius, the dictator, was swearing Flaminius in as his Master of the
Horse, we are told by Plutarch that a rat chanced to squeak, and the
superstitious people compelled both officers to resign their posts.
Office would be held with great uncertainty in Hong Kong if a similar
superstition prevailed. Sir John Bowring has just been swearing in
General Ashburnham as member of the Colonial Council, and if the
rats were silent, they showed unusual modesty. They have forced
themselves, however, into a state paper. Two hundred rats are
destroyed every night in the gaol. Each morning the Chinese
prisoners see, with tearful eyes and watering mouths, a pile of these
delicacies cast out in waste. It is as if Christian prisoners were to see
scores of white sucking pigs tossed forth to the dogs by
Mahommedan gaolers. At last they could refrain no longer. Daring
the punishment of tail-cutting, which follows any infraction of prison
discipline, they first attempted to abstract the delicacies. Foiled in
this, they took the more manly course. They indited a petition in good
Chinese, proving from Confucius that it is sinful to cast away the
food of man, and praying that the meat might be handed over to
them to cook and eat. This is a fact, and if General Thompson
doubts it, I recommend him to move for a copy of the
correspondence.’
A new article of traffic is about to be introduced into the China
market from India, namely, salted rats! The genius with whom the
idea originated, it would appear, is sanguine; so much so, that he
considers himself ‘on the fair road to fortune.’ The speculation
deserves success, if for nothing else than its originality. I have not,
as yet however, observed the price that rules in Whampoa and Hong
Kong nor the commodity quoted in any of the merchants’ circulars,
though it will, doubtless, soon find its place in them as a regular
article of import.
A correspondent of the Calcutta Citizen, writing from Kurrachee, the
chief town of the before mentioned rat infested province of Scinde,
declares that he is determined to export 120,000 salted rats to
China. The Chinese eat rats, and he thinks they may sell. He says:
—‘I have to pay one pice a dozen, and the gutting, salting, pressing,
and packing in casks, raises the price to six pice a dozen (about
three farthings), and if I succeed in obtaining anything like the price
that rules in Whampoa and Canton for corn-grown rats, my fortune is
made, or rather, I will be on the fair road to it, and will open a fine
field of enterprise to Scinde.’
Rats may enter into consumption in other quarters, and among other
people, than those named, when we find such an advertisement as
the following in a recent daily paper at Sydney:—
‘Rats! Rats! Rats!—To-night at 8 o’clock, rattling sport; 200
rats to be entered at G. W. Parker’s Family Hotel.’
Query.—What ultimately becomes of these rats, and who are the
persons who locate and take their meals at this ‘Family Hotel?’
Probably they are of the rough lot whose stomachs are remarkably
strong.
Some classes of the Malabars are very fond of the bandicoot, or pig
rat (Perameles nasuta, Geoff. Desm.), which measures about
fourteen inches in length from head to tail, the tail being nearly as
long as the body. They are much sought after by the coolies, on the
coffee estates in Ceylon, who eat them roasted. They also eat the
coffee rat (Golunda Ellioti of Gray), roasted or fried in oil, which is
much smaller, the head and body only measuring about four or five
inches. These animals are migratory, and commit great damages on
the coffee tree, as many as a thousand having been killed in a day
on one estate. The planters offer a reward for the destruction of
these rodents, which brings grist to the mill in two ways to the coolies
who hunt or entrap them, namely, in money and food.
The fat dormouse (Myoxus glis, Desm.) is used for food in Italy, as it
was by the ancient Romans, who fattened them for the table in
receptacles called Gliraria.
Dr. Rae, in his last arctic exploring expedition, states, that the
principal food of his party was geese, partridges, and lemmings
(Arvicola Hudsonia). These little animals were migrating northward,
and were so numerous that their dogs, as they trotted on, killed as
many as supported them all, without any other food.
There is another singular little animal, termed by naturalists the
vaulting rat, or jerboa. On an Australian species, the Dipus Mitchelli,
the natives of the country between Lake Torrens and the Great
Creek, in Australia seem chiefly to subsist. It is a little larger than a
mouse, and the hind legs are similar to those of the kangaroo.
Captain Sturt and his exploring party once witnessed a curious
scene. They came to a native who had been eating jerboas, and
after they met him they saw him eat one hundred of them. His mode
of cooking was quite unique. He placed a quantity, for a few
seconds, under the ashes of the fire, and then, with the hair only
partially burnt off, took them by the tail, put the body in his mouth,
and bit the tail off with his teeth. After he had eaten a dozen bodies,
he took the dozen tails, and stuffed them into his mouth.
The flesh of the beaver is looked upon as very delicate food by the
North American hunters, but the tail is the choicest dainty, and in
great request. It is much prized by the Indians and trappers,
especially when it is roasted in the skin, after the hair has been
singed off; and in some districts it requires all the influence of the fur-
traders to restrain the hunters from sacrificing a considerable
quantity of beaver fur every year to secure the enjoyment of this
luxury. The Indians of note have generally one or two feasts in a
season, wherein a roasted beaver is the prime dish. It resembles
pork in its flavour, but it requires a strong stomach to sustain a full
meal of it. The flesh is always in high estimation, except when they
have fed upon the fleshy root of a large water lily, which imparts a
rank taste to it.
The flesh of a young porcupine is said to be excellent eating, and
very nutritious. The flavour is something between pork and fowl. To
be cooked properly, it should be boiled first, and afterwards roasted.
This is necessary to soften the thick, gristly skin, which is the best
part of the animal. The flesh of the porcupine is said to be used by
the Italians as a stimulant; but, never having tasted it myself, I
cannot speak from experience as to the virtue of this kind of food.
The Dutch and the Hottentots are very fond of it; and when skinned
and embowelled, the body will sometimes weigh 20 lbs. The flesh is
said to eat better when it has been hung in the smoke of a chimney
for a couple of days.
The flesh of the crested porcupine (Hystrix cristata) is good and very
agreeable eating. Some of the Hudson Bay trappers used to depend
upon the Hystrix dorsata for food at some seasons of the year.
Rabbits, which form so large an article of consumption with us, are
not much esteemed as an article of food by the negroes in the West
Indies, resembling, in their idea, the cat. Thus, a black who is
solicited to buy a rabbit by an itinerant vendor, would indignantly
exclaim, ‘Rabbit? I should just like to no war you take me for,
ma’am? You tink me go buy rabbit? No, ma’am, me no cum to dat
yet; for me always did say, an me always will say, dat dem who eat
rabbit eat pussy, an dem who eat pussy eat rabbit. Get out wid you,
and your rabbit?’
And yet, with all this mighty indignation against rabbits, they do not
object, as we have seen, to a less dainty animal in the shape of the
rat.
Although the negroes in the West Indies do not care for rabbits, yet
their brethren in the American States are by no means averse to
them. A field slave one day found a plump rabbit in his trap. He took
him out alive, held him under his arm, patted him, and began to
speculate on his qualities. ‘Oh, how fat. Berry fat. The fattest I eber
did see. Let me see how I’ll cook him. I’ll broil him. No, he is so fat he
lose all de grease. I fry him. Ah yes. He so berry fat he fry hisself.
Golly, how fat he be. No, I won’t fry him—I stew him.’ The thought of
the savory stew made the negro forget himself, and in spreading out
the feast in his imagination, his arms relaxed, when off hopped the
rabbit, and squatting at a goodly distance, he eyed his late owner
with cool composure. The negro knew there was an end of the stew,
and summoning up all his philosophy, he thus addressed the rabbit,
at the same time shaking his fist at him, ‘You long-eared, white-
whiskered rascal, you not so berry fat arter all.’
I need not here touch upon hare soup, jugged hare, or roasted hare,
from the flesh of our own rodent; but the Arctic hare (Lepus glacialis)
differs considerably from the English in the colour and quality of its
flesh, being less dry, whiter, and more delicately tasted; it may be
dressed in any way. When in good condition it weighs upwards of 10
lbs.
The capybara, or water hog (Hydrochœrus capybara), an ugly-
looking, tailless rodent, the largest of the family, is hunted for its flesh
in South America, and is said to be remarkably good eating. It grows
to the size of a hog two years old.
The flesh of the guinea pig (Cavia cobaya, Desm.) is eaten in South
America, and is said to be not unlike pork. When he is dressed for
the table his skin is not taken off as in other animals, but the hair is
scalded and scraped off in the same manner as it is in a hog.
The white and tender flesh of the agouti (Dasyprocta Acuti, Desm.),
when fat and well dressed, is by no means unpalatable food, but
very delicate and digestible. It is met with in Brazil, Guiana, and in
Trinidad. The manner of dressing them in the West Indies used to be
to roast them with a pudding in their bellies. Their skin is white, as
well as the flesh.
The flesh of the brown paca (Cœlogenus subniger, Desm.), a nearly
allied animal, is generally very fat, and also accounted a great
delicacy in Brazil.
Another South American rodent, the bizcacha, or viscascha
(Lagostomus trichodactylus), is eaten for food. It somewhat
resembles a rabbit, but has larger gnawing teeth, and a long tail. The
flesh, when cooked, is very white and good.

EDENTATA, OR TOOTHLESS ANIMALS.


Wallace, in his travels on the Amazon, tells us that the Indians
stewed a sloth for their dinner, and as they considered the meat a
great delicacy, he tasted it, and found it tender and very palatable.
Among other extraordinary animals for which Australia is proverbial,
is the Echidna hystrix, or native porcupine, which is eaten by the
aborigines, who declare it to be ‘cobbong budgeree (very good), and,
like pig, very fat.’ Europeans who have eaten of them confirm this
opinion, and observe that they taste similar to a sucking pig. There
appear to be two species of this animal, the spiny echidna and the
bristly echidna; the first attains a large size, equalling the ordinary
hedgehog. It has the external coating and general appearance of the
porcupine, with the mouth and peculiar generic character of the ant-
eater.
The flesh of the great ant-eater (Myrmecophaga jubata, Linn.) is
esteemed a delicacy by the Indians and negro slaves in Brazil, and,
though black and of a strong musky flavour, is sometimes even met
with at the tables of Europeans.
The armadillo, remarkable for its laminated shell, when baked in its
scaly coat is a good treat, the flesh being considered delicate eating,
somewhat like a rabbit in taste and colour. The flesh of the large
twelve-banded Brazilian one (Dasypus Tatouay) is said to be the
best of all. In South America there are several species of armadillo,
all of which are used for food when met with.
Mr. Gosse states, that this animal feeds upon soft ground fruits and
roots, and also on carrion, whenever it can find it; and a large
proportion of the sustenance of this, as well as of other species, is
derived from the numberless wild cattle which are caught and
slaughtered on the Pampas for the sake of their hides and tallow, the
carcases being left as valueless to decay, or to become the prey of
wild animals. Notwithstanding the filthy nature of their food, the
armadillos, being very fat, are eagerly sought for by the inhabitants
of European descent, as well as by the Indians. The animal is
roasted in its shell, and is esteemed one of the greatest delicacies of
the country; the flesh is said to resemble that of a sucking pig.
PACHYDERMATA, OR THICK-SKINNED
ANIMALS.
What do our African brethren consider tit-bits? Ask Gordon
Cumming. He will enumerate a list longer than you can remember.
Study his ‘Adventures,’ and you will become learned in the mystery
of African culinary operations. What are sheep’s-trotters and insipid
boiled calves’ feet compared to baked elephants’ paws?
Listen to his description of the whole art and mystery of the process
of preparing them:—
‘The four feet are amputated at the fetlock joint, and the trunk, which
at the base is about two feet in thickness, is cut into convenient
lengths. Trunk and feet are then baked, preparatory to their removal
to headquarters. The manner in which this is done is as follows:—A
party, provided with sharp-pointed sticks, dig a hole in the ground for
each foot and a portion of the trunk. These holes are about two feet
deep and a yard in width; the excavated earth is embanked around
the margin of the holes. This work being completed, they next collect
an immense quantity of dry branches and trunks of trees, of which
there is always a profusion scattered around, having been broken by
the elephants in former years. These they pile above the holes to the
height of eight or nine feet, and then set fire to the heap. When these
strong fires have burnt down, and the whole of the wood is reduced
to ashes, the holes and the surrounding earth are heated to a high
degree. Ten or twelve men then stand round the pit and take out the
ashes with a pole about sixteen feet in length, having a hook at the
end. They relieve one another in quick succession, each man
running in and raking the ashes for a few seconds, and then pitching
the pole to his comrade, and retreating, since the heat is so intense
that it is scarcely to be endured. When all the ashes are thus raked
out beyond the surrounding bank of earth, each elephant’s foot and
portion of the trunk is lifted by two athletic men, standing side by
side, who place it on their shoulders, and, approaching the pit
together, they heave it into it. The long pole is now again resumed,
and with it they shove in the heated bank of earth upon the foot,
shoving and raking until it is completely buried in the earth. The hot
embers, of which there is always a great supply, are then raked into
a heap above the foot, and another bonfire is kindled over each,
which is allowed to burn down and die a natural death; by which time
the enormous foot or trunk will be found to be equally baked
throughout its inmost parts. When the foot is supposed to be ready, it
is taken out of the ground with pointed sticks, and is first well beaten,
and then scraped with an assagai, whereby adhering particles of
sand are got rid of. The outside is then pared off, and it is transfixed
with a sharp stake for facility of carriage. The feet thus cooked are
excellent, as is also the trunk, which very much resembles buffalo’s
tongue.’
Elephants’ petit(?) toes, pickled in strong toddy vinegar and cayenne
pepper, are considered in Ceylon an Apician luxury. As soon as it is
known that an elephant has been killed in Africa, every man in the
neighbourhood sets off with his knife and basket for the place, and
takes home as much of the carcase as he can manage to carry. The
flesh is not only eaten when fresh, but is dried and kept for months,
and is then highly esteemed.
The manner in which the elephant is cut up is thus described by the
author and sportsman I have already quoted:—‘The rough outer skin
is first removed, in large sheets, from the side which lies uppermost.
Several coats of an under skin are then met with. The skin is of a
tough and pliant nature, and is used by the natives for making water-
bags, in which they convey supplies of water from the nearest vey,
or fountain (which is often ten miles distant), to the elephant. They
remove this inner skin with caution, taking care not to cut it with the
assagai; and it is formed into water bags by gathering the corners
and edges, and transfixing the whole on a pointed wand. The flesh is
then removed in enormous sheets from the ribs, when the hatchets
come into play, with which they chop through and remove
individually each colossal rib. The bowels are thus laid bare; and in
the removal of these the leading men take a lively interest and active
part, for it is throughout and around the bowels that the fat of the
elephant is mainly found. There are few things which a Bechuana
prizes so highly as fat of any description; they will go an amazing
distance for a small portion of it. They use it principally in cooking
their sun-dried biltongue, and they also eat it with their corn. The fat
of the elephant lies in extensive layers and sheets in his inside, and
the quantity which is obtained from a full-grown bull, in high
condition, is very great. Before it can be obtained, the greater part of
the bowels must be removed. To accomplish this, several men
eventually enter the immense cavity of his inside, where they
continue mining away with their assagais, and handing the fat to
their comrades outside till all is bare. While this is transpiring with the
sides and bowels, other parties are equally active in removing the
skin and flesh from the remaining parts of the carcase.
‘In Northern Cachar, India, the flesh of the elephant is generally
eaten. The Kookies encamp in the neighbourhood of the carcase
until they have entirely consumed it, or are driven away by the
effluvia of decomposition. Portions of the flesh that they cannot
immediately eat are dried and smoked to be kept for future
consumption.
‘Fat of any kind is a complete godsend to the Bechuana and other
tribes of Southern Africa; and the slaughter of an elephant affords
them a rich harvest in disembowelling the carcase, and mining their
way into the interior of the huge cavity to remove the immense layers
furnished by such a large animal if in good condition.’
Galton, the African traveller, in his hints for bush cooking, tells us:—
‘The dish called beatee is handy to make. It is a kind of haggis made
with blood, a good quantity of fat shred small, some of the tenderest
of the flesh, together with the heart and lungs of the animal, cut or
torn into small shivers, all of which is put into the stomach and
roasted, by being suspended before the fire with a string. Care must
be taken that it does not get too much heat at first, or it will burst. It is
a most delicious morsel, even without pepper, salt, or any
seasoning.’
In all the large rivers of Southern Africa, and especially towards the
mouths, the hippopotami abound. The colonists give them the name
of sea-cows. The capture of one of these huge beasts, weighing, as
they sometimes do, as much as four or five large oxen, is an
immense prize to the hungry Bushman or Koranna, as the flesh is by
no means unpalatable; and the fat, with which these animals are
always covered, is considered delicious. When salted it is called zee-
koe speck, is very much like excellent fat bacon, and is greatly
prized by the Dutch colonists, not only for the table, but for the
reputed medicinal qualities which are attributed to it. In Abyssinia,
hippopotamus meat is commonly eaten.
The hog is one of those animals that are doomed to clear the earth
of refuse and filth, and that convert the most nauseous offal into the
nicest nutriment in its flesh. It has not altogether been unaptly
compared to a miser, who is useless and rapacious in his life, but at
his death becomes of public use by the very effects of his sordid
manners. During his life he renders little service to mankind, except
in removing that filth which other animals reject.
A delicate sucking pig, a Bath chap, or a good rasher of bacon are,
however, tit-bits not to be despised.
Lord Brougham hoped to see the day when every man in the United
Kingdom would read Bacon. ‘It would be much better to the
purpose,’ said Cobbett, ‘if his lordship would use his influence that
every man in the kingdom could eat bacon.’
In British India, only Europeans and the low Hindoos eat pork, but
wild hogs are very abundant, and afford good sport to the hunter.
The avoidance of pork arises as much from religious scruples as the
deep-rooted aversion to the domestic swine all must imbibe who
have only seen it in the East, where it is a tall, gaunt, half famished,
and half ferocious-looking brute, which performs the office of
scavenger.
The legend which ascribes to the eating of human flesh the origin of
one of the most loathsome of diseases, scarce offers a more horrible
picture to the imagination than is presented by a letter recently
published in the Ceylon Examiner. The beautiful islands of Mauritius
and Bourbon are largely supplied with pork from Patna, a province of
Hindostan that has been over-run by the cholera. Both there and at
Calcutta the bodies of the natives are consigned to the Ganges,
instead of being interred. ‘Let any person,’ says the writer in the
Ceylon paper, ‘at daybreak start from the gates of Government
House, Calcutta, and, whether his walk will be to the banks of the
river or to the banks of the canals which on three sides surround the
city, he will see pigs feeding on the dead bodies of the natives that
have been thrown there during the night. During the day the river
police clear away and sink all that remains of the bodies. Bad as is
the metropolis of India it is nothing compared to Patna. Hundreds
upon hundreds of human corpses are there strewed along the
strand; and fattening, ghoule-like, upon these are droves upon
droves of swine. These swine are slaughtered, cut up, and salted
into hams, bacon, and pickled pork, and then despatched to
Calcutta.... The great market for this poisonous swine produce is the
Mauritius and Bourbon, where it is foisted on the inhabitants as the
produce of Europe. Moreover, as these swine are sold in Calcutta at
3s. or 4s. each carcase, it is stated that the inferior class of
homeward-bound vessels are provisioned with them, and thus this
human-fed pork is introduced into Europe and America.’
Pork-eaters may believe as much of the following remarks as they
please. ‘It is said that the Jews, Turks, Arabians, and all those who
observe the precept of avoiding blood and swine’s flesh, are infinitely
more free from disease than Christians; more especially do they
escape those opprobria of the medical art, gout, scrofula,
consumption, and madness. The Turks eat great quantities of honey
and pastry, and much sugar; they also eat largely, and are indolent,
and yet do not suffer from dyspepsia as Christians do. The swine-fed
natives of Christendom suffer greater devastation from a tubercular
disease of the bowels (dysentery) than from any other cause. Those
persons who abstain from swine’s flesh and blood are infinitely more
healthy and free from humors, glandular diseases, dyspepsia, and
consumption; while in those districts, and among those classes, of
men, where the pig makes the chief article of diet, tubercle in all its
forms of eruptions, sore legs, bad eyes, abscesses, must prevail.’
These are the remarks of an American journalist, which, however,
have not, I conceive, the shadow of foundation.
‘It appears somewhat singular,’ remarks Mr. Richardson, in his
history of the pig, ‘that the flesh of the hog was prohibited in the
ceremonial of the Jewish law; the same prohibition being afterwards
borrowed by Mahomet, and introduced into the Koran.’ Great
difference of opinion prevails as to the cause of this prohibition;
some alleging that this food was unsuited to the land inhabited by
the Jews. As, however, the kinds of food to be eaten and rejected—
doubtless to prevent that luxurious epicurism unsuited to a growing
and prosperous nation—were to have a limit, this limit was fixed by
two distinctive marks: they must ‘divide the hoof, and chew the cud;’
that principle of restriction admitting only a limited range to the food
permitted. The pig, the horse, and the camel were excluded. It was
only in a state of low nationality, or in times of great degeneracy, that
the Jew ever tasted pork.
The food of the hog varies in different localities, and probably
materially influences the flavour of the meat. In the River Plata
provinces they feed them on mutton. After describing the purchase—
8,000 at eighteen-pence per dozen (?)—by a Mr. M. Handy, a
traveller adds, ‘As soon as the sheep became fattened on his own
lands, he killed about a thousand, sold the fleeces at five shillings
per dozen, and with the mutton he fed a herd of swine. Mentioning
this fact to a large party of Europeans, at the dinner table of Lord
Howden, when in Buenos Ayres, my statement was received with a
murmur of scepticism; but I offered to accompany the incredulous to
the pastures, where the remainder of the sheep were then
feeding.’—(Two Thousand Miles’ Ride through the Argentine
Provinces.) But the Yankees beat this, according to a late American
paper. In North America they generally feed them on maize, but in
some of the States, apples form a principal portion of their food, and
the ‘apple sauce’ thus becomes incorporated with the flesh. A
gentleman travelling down East, overtook a farmer dragging a lean,
wretched-looking, horned sheep along the road. ‘Where are you
going with that miserable animal?’ asked the traveller. ‘I am taking
him to the mutton mill, to have him ground over,’ said the farmer.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like