Log In
Or create an account -> 
Imperial Library
  • Home
  • About
  • News
  • Upload
  • Forum
  • Help
  • Login/SignUp

Index
SPECIAL OFFER: Upgrade this ebook with O’Reilly Acknowledgments 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
I. Learning the Shell
1. What Is the Shell?
Terminal Emulators Your First Keystrokes
Command History Cursor Movement
Try Some Simple Commands Ending a Terminal Session
2. Navigation
Understanding the Filesystem Tree The Current Working Directory Listing the Contents of a Directory Changing the Current Working Directory
Absolute Pathnames Relative Pathnames Some Helpful Shortcuts
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 A Guided Tour Symbolic Links
4. Manipulating Files and Directories
Wildcards mkdir—Create Directories cp—Copy Files and Directories mv—Move and Rename Files rm—Remove Files and Directories ln—Create Links
Hard Links Symbolic Links
Let’s Build a Playground
Creating Directories Copying Files Moving and Renaming Files Creating Hard Links Creating Symbolic Links Removing Files and Directories
Final Note
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 a Very Brief Description of a Command info—Display a Program’s Info Entry README and Other Program Documentation Files
Creating Your Own Commands with alias Revisiting Old Friends
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
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
Final Note
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
Final Note
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
Final Note
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
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 Your Privileges Changing Your Password
10. Processes
How a Process Works
Viewing Processes with ps 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
Sending Signals to Processes with kill Sending Signals to Multiple Processes with killall
More Process-Related Commands
II. Configuration and the Environment
11. The Environment
What Is Stored in the Environment?
Examining the Environment Some Interesting Variables
How Is the Environment Established?
Login and Non-login Shells What’s in a Startup File?
Modifying the Environment
Which Files Should We Modify? Text Editors Using a Text Editor Activating Our Changes
Final Note
12. A Gentle Introduction to vi
Why We Should Learn vi A Little Background Starting and Stopping vi Editing Modes
Entering Insert Mode Saving Our Work
Moving the Cursor Around Basic Editing
Appending Text Opening a Line Deleting Text Cutting, Copying, and Pasting Text Joining Lines
Search and Replace
Searching Within a Line Searching the Entire File Global Search and Replace
Editing Multiple Files
Switching Between Files Opening Additional Files for Editing Copying Content from One File into Another Inserting an Entire File into Another
Saving Our Work
13. Customizing the Prompt
Anatomy of a Prompt Trying Some Alternative Prompt Designs Adding Color Moving the Cursor Saving the Prompt Final Note
III. Common Tasks and Essential Tools
14. Package Management
Packaging Systems How a Package System Works
Package Files Repositories Dependencies High- and Low-Level Package Tools
Common Package Management Tasks
Finding a Package in a Repository Installing a Package from a Repository Installing a Package from a Package File Removing a Package Updating Packages from a Repository Upgrading a Package from a Package File Listing Installed Packages Determining Whether a Package Is Installed Displaying Information About an Installed Package Finding Which Package Installed a File
Final Note
15. Storage Media
Mounting and Unmounting Storage Devices
Viewing a List of Mounted Filesystems Determining Device Names
Creating New Filesystems
Manipulating Partitions with fdisk Creating a New Filesystem with mkfs
Testing and Repairing Filesystems Formatting Floppy Disks Moving Data Directly to and from Devices Creating CD-ROM Images
Creating an Image Copy of a CD-ROM Creating an Image from a Collection of Files
Writing CD-ROM Images
Mounting an ISO Image Directly Blanking a Rewritable CD-ROM Writing an Image
Extra Credit
16. Networking
Examining and Monitoring a Network
ping—Send a Special Packet to a Network Host traceroute—Trace the Path of a Network Packet netstat—Examine Network Settings and Statistics
Transporting Files over a Network
ftp—Transfer Files with the File Transfer Protocol lftp—A Better ftp wget—Non-interactive Network Downloader
Secure Communication with Remote Hosts
ssh—Securely Log in to Remote Computers scp and sftp—Securely Transfer Files
17. Searching for Files
locate—Find Files the Easy Way find—Find Files the Hard Way
Tests Actions A Return to the Playground Options
18. Archiving and Backup
Compressing Files
gzip—Compress or Expand Files bzip2—Higher Compression at the Cost of Speed
Archiving Files
tar—Tape Archiving Utility zip—Package and Compress Files
Synchronizing Files and Directories
rsync—Remote File and Directory Synchronization Using rsync over a Network
19. Regular Expressions
What Are Regular Expressions? grep—Search Through Text Metacharacters and Literals The Any Character Anchors Bracket Expressions and Character Classes
Negation Traditional Character Ranges POSIX Character Classes
POSIX Basic vs. Extended Regular Expressions Alternation Quantifiers
?—Match an Element Zero Times or One Time *—Match an Element Zero or More Times +—Match an Element One or More Times { }—Match an Element a Specific Number of Times
Putting Regular Expressions to Work
Validating a Phone List with grep Finding Ugly Filenames with find Searching for Files with locate Searching for Text with less and vim
Final Note
20. Text Processing
Applications of Text
Documents Web Pages Email Printer Output Program Source Code
Revisiting Some Old Friends
cat—Concatenate Files and Print on Standard Output sort—Sort Lines of Text Files uniq—Report or Omit Repeated Lines
Slicing and Dicing
cut—Remove Sections from Each Line of Files paste—Merge Lines of Files join—Join Lines of Two Files on a Common Field
Comparing Text
comm—Compare Two Sorted Files Line by Line diff—Compare Files Line by Line patch—Apply a diff to an Original
Editing on the Fly
tr—Transliterate or Delete Characters sed—Stream Editor for Filtering and Transforming Text aspell—Interactive Spell Checker
Final Note Extra Credit
21. Formatting Output
Simple Formatting Tools
nl—Number Lines fold—Wrap Each Line to a Specified Length fmt—A Simple Text Formatter pr—Format Text for Printing printf—Format and Print Data
Document Formatting Systems
The roff Family and TEX groff—A Document Formatting System
Final Note
22. Printing
A Brief History of Printing
Printing in the Dim Times Character-Based Printers Graphical Printers
Printing with Linux Preparing Files for Printing
pr—Convert Text Files for Printing
Sending a Print Job to a Printer
lpr—Print Files (Berkeley Style) lp—Print Files (System V Style) Another Option: a2ps
Monitoring and Controlling Print Jobs
lpstat—Display Print System Status lpq—Display Printer Queue Status lprm and cancel—Cancel Print Jobs
23. Compiling Programs
What Is Compiling?
Are All Programs Compiled?
Compiling a C Program
Obtaining the Source Code Examining the Source Tree Building the Program Installing the Program
Final Note
IV. Writing Shell Scripts
24. Writing Your First Script
What Are Shell Scripts? How to Write a Shell Script
Script File Format Executable Permissions Script File Location Good Locations for Scripts
More Formatting Tricks
Long Option Names Indentation and Line Continuation
Final Note
25. Starting a Project
First Stage: Minimal Document Second Stage: Adding a Little Data Variables and Constants
Creating Variables and Constants Assigning Values to Variables and Constants
Here Documents Final Note
26. Top-Down Design
Shell Functions Local Variables Keep Scripts Running Final Note
27. Flow Control: Branching with if
Using if Exit Status Using test
File Expressions String Expressions Integer Expressions
A More Modern Version of test (( ))—Designed for Integers Combining Expressions Control Operators: Another Way to Branch Final Note
28. Reading Keyboard Input
read—Read Values from Standard Input
Options Separating Input Fields with IFS
Validating Input Menus Final Note Extra Credit
29. Flow Control: Looping with while and until
Looping while Breaking out of a Loop until Reading Files with Loops Final Note
30. Troubleshooting
Syntactic Errors
Missing Quotes Missing or Unexpected Tokens Unanticipated Expansions
Logical Errors
Defensive Programming Verifying Input
Testing
Stubs Test Cases
Debugging
Finding the Problem Area Tracing Examining Values During Execution
Final Note
31. Flow Control: Branching with case
case
Patterns Combining Multiple Patterns
Final Note
32. Positional Parameters
Accessing the Command Line
Determining the Number of Arguments shift—Getting Access to Many Arguments Simple Applications Using Positional Parameters with Shell Functions
Handling Positional Parameters En Masse A More Complete Application Final Note
33. Flow Control: Looping with for
for: Traditional Shell Form for: C Language Form Final Note
34. Strings and Numbers
Parameter Expansion
Basic Parameters Expansions to Manage Empty Variables Expansions That Return Variable Names String Operations
Arithmetic Evaluation and Expansion
Number Bases Unary Operators Simple Arithmetic Assignment Bit Operations Logic
bc—An Arbitrary-Precision Calculator Language
Using bc An Example Script
Final Note Extra Credit
35. Arrays
What Are Arrays? Creating an Array Assigning Values to an Array Accessing Array Elements Array Operations
Outputting the Entire Contents of an Array Determining the Number of Array Elements Finding the Subscripts Used by an Array Adding Elements to the End of an Array Sorting an Array Deleting an Array
Final Note
36. Exotica
Group Commands and Subshells
Performing Redirections Process Substitution
Traps Asynchronous Execution
wait
Named Pipes
Setting Up a Named Pipe Using Named Pipes
Final Note
Index A. Updates SPECIAL OFFER: Upgrade this ebook with O’Reilly
  • ← Prev
  • Back
  • Next →
  • ← Prev
  • Back
  • Next →

Chief Librarian: Las Zenow <zenow@riseup.net>
Fork the source code from gitlab
.

This is a mirror of the Tor onion service:
http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion