Linux Command Line and Shell Scripting Bible, Second Edition
โ Scribed by Richard Blum, Christine Bresnahan
- Publisher
- Wiley
- Year
- 2011
- Tongue
- English
- Leaves
- 838
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
โฆ Synopsis
The authoritative guide to Linux command line and shell scripting?completely updated and revised [it's not a guide to Linux as a whole ? just to scripting]
The Linux command line allows you to type specific Linux commands directly to the system so that you can easily manipulate files and query system resources, thereby permitting you to automate commonly used functions and even schedule those programs to run automatically. This new edition is packed with new and revised content, reflecting the many changes to new Linux versions, including coverage of alternative shells to the default bash shell. For this edition, the author has teamed up with another Linux expert ? with their shared expertise, they take you beyond the basics of shell scripting and guide you through using shell scripting for higher-level applications that are commonly found in Linux environments. In addition, this edition features a host of real-world examples, so you can see how the scripts work in application.
- Reflects changes to new Linux versions and covers alternate shells to the default bash shell
- Offers new chapters on working with file system commands and software installation commands
- Includes a plethora of real-world examples of advanced shell scripting
- Shows how to use shell scripts in a graphical desktop environment
With Linux Command Line and Shell Scripting Bible you'll learn to manage file systems, install software, write scripts for graphical desktops, work with alternative shells, and more.
โฆ Table of Contents
Linuxยฎ Command Line and Shell Scripting Bible
Contents
Introduction
Part I: The Linux Command Line
Chapter 1: Starting with Linux Shells
What Is Linux?
Looking into the Linux Kernel
The GNU Utilities
The Linux Desktop Environment
Linux Distributions
Core Linux Distributions
Specialized Linux Distributions
The Linux LiveCD
Summary
Chapter 2: Getting to the Shell
Terminal Emulation
Graphics Capabilities
The Keyboard
The terminfo Database
The Linux Console
The xterm Terminal
Command Line Parameters
The xterm Main Menu
The VT Options Menu
The VT Fonts Menu
The Konsole Terminal
Command Line Parameters
Tabbed Window Sessions
Profiles
The Menu Bar
The GNOME Terminal
The Command Line Parameters
Tabs
The Menu Bar
Summary
Chapter 3: Basic bash Shell Commands
Starting the Shell
The Shell Prompt
The Bash Manual
Filesystem Navigation
The Linux Filesystem
Traversing Directories
File and Directory Listing
Basic Listing
Modifying the Information Presented
The Complete Parameter List
Filtering Listing Output
File Handling
Creating Files
Copying Files
Linking Files
Renaming Files
Deleting Files
Directory Handling
Creating Directories
Deleting Directories
Viewing File Contents
Viewing File Statistics
Viewing the File Type
Viewing the Whole File
Viewing Parts of a File
Summary
Chapter 4: More bash Shell Commands
Monitoring Programs
Peeking at the Processes
Real-Time Process Monitoring
Stopping Processes
Monitoring Disk Space
Mounting Media
Using the df Command
Using the du Command
Working with Data Files
Sorting Data
Searching for Data
Compressing Data
Archiving Data
Summary
Chapter 5: Using Linux Environment Variables
What Are Environment Variables?
Global Environment Variables
Local Environment Variables
Setting Environment Variables
Setting Local Environment Variables
Setting Global Environment Variables
Removing Environment Variables
Default Shell Environment Variables
Setting the PATH Environment Variable
Locating System Environment Variables
Login Shell
Interactive Shell
Non-Interactive Shell
Variable Arrays
Using Command Aliases
Summary
Chapter 6: Understanding Linux File Permissions
Linux Security
The /etc/passwd File
The /etc/shadow File
Adding a New User
Removing a User
Modifying a User
Using Linux Groups
The /etc/group File
Creating New Groups
Modifying Groups
Decoding File Permissions
Using File Permission Symbols
Default File Permissions
Changing Security Settings
Changing Permissions
Changing Ownership
Sharing Files
Summary
Chapter 7: Managing Filesystems
Exploring Linux Filesystems
The Basic Linux Filesystems
Journaling Filesystems
The Extended Linux Journaling Filesystems
Working with Filesystems
Creating Partitions
Creating a Filesystem
If Things Go Wrong
Logical Volume Managers
The Logical Volume Management Layout
The LVM in Linux
Using the Linux LVM
Summary
Chapter 8: Installing Software
Package Management Primer
The Debian-Based Systems
Managing Packages with aptitude
Installing Software Packages with aptitude
Updating Software with aptitude
Uninstalling Software with aptitude
The aptitude Repositories
The Red HatโBased Systems
Listing Installed Packages
Installing Software with yum
Updating Software with yum
Uninstalling Software with yum
Dealing with Broken Dependencies
Yum Repositories
Installing from Source Code
Summary
Chapter 9: Working with Editors
The vim Editor
The Basics of vim
Editing Data
Copy and Paste
Search and Substitute
The emacs Editor
Using emacs on the Console
Using emacs in X Windows
The KDE Family of Editors
The KWrite Editor
The Kate Editor
The GNOME Editor
Starting gedit
Basic gedit Features
Setting Preferences
Summary
Part II: Shell Scripting Basics
Chapter 10: Basic Script Building
Using Multiple Commands
Creating a Script File
Displaying Messages
Using Variables
Environment Variables
User Variables
The Backtick
Redirecting Input and Output
Output Redirection
Input Redirection
Pipes
Performing Math
The expr Command
Using Brackets
A Floating-Point Solution
Exiting the Script
Checking the exit Status
The exit Command
Summary
Chapter 11: Using Structured Commands
Working with the if-then Statement
The if-then-else Statement
Nesting ifs
The test Command
Numeric Comparisons
String Comparisons
File Comparisons
Compound Condition Testing
Advanced if-then Features
Using Double Parentheses
Using Double Brackets
The case Command
Summary
Chapter 12: More Structured Commands
The for Command
Reading Values in a List
Reading Complex Values in a List
Reading a List from a Variable
Reading Values from a Command
Changing the Field Separator
Reading a Directory Using Wildcards
The C-Style for Command
The C Language for Command
Using Multiple Variables
The while Command
Basic while Format
Using Multiple Test Commands
The until Command
Nesting Loops
Looping on File Data
Controlling the Loop
The break Command
The continue Command
Processing the Output of a Loop
Summary
Chapter 13: Handling User Input
Command Line Parameters
Reading Parameters
Reading the Program Name
Testing Parameters
Special Parameter Variables
Counting Parameters
Grabbing All the Data
Being Shifty
Working with Options
Finding Your Options
Using the getopt Command
The More Advanced getopts
Standardizing Options
Getting User Input
Basic Reading
Timing Out
Silent Reading
Reading from a File
Summary
Chapter 14: Presenting Data
Understanding Input and Output
Standard File Descriptors
Redirecting Errors
Redirecting Output in Scripts
Temporary Redirections
Permanent Redirections
Redirecting Input in Scripts
Creating Your Own Redirection
Creating Output File Descriptors
Redirecting File Descriptors
Creating Input File Descriptors
Creating a Read/Write File Descriptor
Closing File Descriptors
Listing Open File Descriptors
Suppressing Command Output
Using Temporary Files
Creating a Local Temporary File
Creating a Temporary File in /tmp
Creating a Temporary Directory
Logging Messages
Summary
Chapter 15: Script Control
Handling Signals
Linux Signals Revisited
Generating Signals
Trapping Signals
Trapping a Script Exit
Removing a Trap
Running Scripts in Background Mode
Running in the Background
Running Multiple Background Jobs
Exiting the Terminal
Running Scripts Without a Console
Job Control
Viewing Jobs
Restarting Stopped Jobs
Being Nice
The nice Command
The renice Command
Running Like Clockwork
Scheduling a Job Using the at Command
Scheduling Regular Scripts
Start at the Beginning
Starting Your Scripts at Boot Time
Starting with a New Shell
Summary
PART III: Advanced Shell Scripting
Chapter 16: Creating Functions
Basic Script Functions
Creating a Function
Using Functions
Returning a Value
The Default Exit Status
Using the return Command
Using Function Output
Using Variables in Functions
Passing Parameters to a Function
Handling Variables in a Function
Array Variables and Functions
Passing Arrays to Functions
Returning Arrays from Functions
Function Recursion
Creating a Library
Using Functions on the Command Line
Creating Functions on the Command Line
Defining Functions in the .bashrc File
Summary
Chapter 17: Writing Scripts for Graphical Desktops
Creating Text Menus
Create the Menu Layout
Create the Menu Functions
Add the Menu Logic
Putting It All Together
Using the select Command
Doing Windows
The dialog Package
The dialog Options
Using the dialog Command in a Script
Getting Graphic
The KDE Environment
The GNOME Environment
Summary
Chapter 18: Introducing sed and gawk
Text Manipulation
The sed Editor
The gawk Program
The sed Editor Basics
More Substitution Options
Using Addresses
Deleting Lines
Inserting and Appending Text
Changing Lines
The transform Command
Printing Revisited
Using Files with sed
Summary
Chapter 19: Regular Expressions
What Are Regular Expressions?
A Definition
Types of Regular Expressions
Defining BRE Patterns
Plain Text
Special Characters
Anchor Characters
The Dot Character
Character Classes
Negating Character Classes
Using Ranges
Special Character Classes
The Asterisk
Extended Regular Expressions
The Question Mark
The Plus Sign
Using Braces
The Pipe Symbol
Grouping Expressions
Regular Expressions in Action
Counting Directory Files
Validating a Phone Number
Parsing an E-mail Address
Summary
Chapter 20: Advanced sed
Multiline Commands
The next Command
The Multiline delete Command
The Multiline print Command
The Hold Space
Negating a Command
Changing the Flow
Branching
Testing
Pattern Replacement
The Ampersand
Replacing Individual Words
Using sed in Scripts
Using Wrappers
Redirecting sed Output
Creating sed Utilities
Double Spacing Lines
Double Spacing Files That May Have Blanks
Numbering Lines in a File
Printing Last Lines
Deleting Lines
Removing HTML Tags
Summary
Chapter 21: Advanced gawk
Using Variables
Built-in Variables
User-Defined Variables
Working with Arrays
Defining Array Variables
Iterating Through Array Variables
Deleting Array Variables
Using Patterns
Regular Expressions
The Matching Operator
Mathematical Expressions
Structured Commands
The if Statement
The while Statement
The do-while Statement
The for Statement
Formatted Printing
Built-in Functions
Mathematical Functions
String Functions
Time Functions
User-Defined Functions
Defining a Function
Using Your Functions
Creating a Function Library
Summary
Chapter 22: Working with Alternative Shells
What Is the dash Shell?
The dash Shell Features
The dash Command Line Parameters
The dash Environment Variables
The dash Built-in Commands
Scripting in dash
Creating dash Scripts
Things That Wonโt Work
The zsh Shell
Parts of the zsh Shell
Shell Options
Built-in Commands
Scripting with zsh
Mathematical Operations
Structured Commands
Functions
Summary
Part IV: Advanced Shell Scripting Topics
Chapter 23: Using a Database
The MySQL Database
Installing MySQL
The MySQL Client Interface
Creating MySQL Database Objects
The PostgreSQL Database
Installing PostgreSQL
The PostgreSQL Command Interface
Creating PostgreSQL Database Objects
Working with Tables
Creating a Table
Inserting and Deleting Data
Querying Data
Using the Database in Your Scripts
Connecting to the Databases
Sending Commands to the Server
Formatting Data
Summary
Chapter 24: Using the Web
The Lynx Program
Installing Lynx
The lynx Command Line
The Lynx Configuration File
The Lynx Environment Variables
Capturing Data from Lynx
The cURL Program
Installing cURL
Exploring with cURL
Networking with zsh
The TCP Module
The Client/Server Paradigm
Client/Server Programming with zsh
Summary
Chapter 25: Using E-mail
The Basics of Linux E-Mail
E-Mail in Linux
The Mail Transfer Agent
The Mail Delivery Agent
The Mail User Agent
Setting Up Your Server
sendmail
Postfix
Sending a Message with Mailx
The Mutt Program
Installing Mutt
The Mutt Command Line
Using Mutt
Summary
Chapter 26: Writing Script Utilities
Monitoring Disk Space
The Required Functions
Creating the Script
Running the Script
Performing Backups
Archiving Data Files
Managing User Accounts
The Required Functions
Creating the Script
Summary
Chapter 27: Advanced Shell Scripts
Monitoring System Statistics
System Snapshot Report
System Statistics Report
Problem-Tracking Database
Creating the Database
Recording a Problem
Updating a Problem
Finding a Problem
Summary
Appendix A: Quick Guide to bash Commands
Built-in Commands
Bash Commands
Environment Variables
Appendix B: Quick Guide to sed and gawk
The sed Editor
Starting the sed Editor
sed Commands
The gawk Program
The gawk Command Format
Using gawk
The gawk Variables
The gawk Program Features
Index
๐ SIMILAR VOLUMES
<p><span>Advance your understanding of the Linux command line with this invaluable resourceย </span></p><p><span>Linux Command Line and Shell Scripting Bible,ย 4th Edition</span><span>ย is the newest installment in the indispensable series known to Linux developers all over the world.ย Packed with concr
<p><span>Advance your understanding of the Linux command line with this invaluable resourceย </span></p><p><span>Linux Command Line and Shell Scripting Bible,ย 4th Edition</span><span>ย is the newest installment in the indispensable series known to Linux developers all over the world.ย Packed with concr
Talk directly to your system for a faster workflow with automation capability Linux Command Line and Shell Scripting Bible is your essential Linux guide. With detailed instruction and abundant examples, this book teaches you how to bypass the graphical interface and communicate directly with your
Introduction -- Part I. The Linux command line. Chapter 1: Starting with Linux shells -- Chapter 2: Getting to the shell -- Chapter 3: Basic bash shell commands -- Chapter 4: More bash shell commands -- Chapter 5: Using Linux environment variables -- Chapter 6: Understanding Linux file permissions -