Preface | p. xv |
Introduction | p. 1 |
What is Unix? | p. 2 |
Available Shell Types | p. 2 |
What is bash? | p. 3 |
Getting help for bash Commands | p. 4 |
Navigating Around Directories | p. 4 |
The history Command | p. 4 |
Listing Filenames with the Is Command | p. 5 |
Displaying Contents of Files | p. 8 |
The cat Command | p. 8 |
The head and tail Commands | p. 9 |
The Pipe Symbol | p. 10 |
The fold Command | p. 11 |
File Ownership: Owner, Group, and World | p. 11 |
Hidden Files | p. 12 |
Handling Problematic Filenames | p. 13 |
Working with Environment Variables | p. 13 |
The env Command | p. 13 |
Useful Environment Variables | p. 14 |
Setting the PATH Environment Variable | p. 14 |
Specifying Aliases and Environment Variables | p. 15 |
Finding Executable Files | p. 16 |
The printf Command and the echo Command | p. 17 |
The cut Command | p. 17 |
The echo Command and Whitespaces | p. 18 |
Command Substitution ("backtick") | p. 20 |
The pipe" Symbol and Multiple Commands | p. 20 |
Using a Semicolon to Separate Commands | p. 21 |
The paste Command | p. 22 |
Inserting Blank Lines with the paste Command | p. 22 |
A Simple Use Case with the paste Command | p. 23 |
A Simple Use Case with cut and paste Commands | p. 24 |
What about zsh? | p. 25 |
Switching between bash and zsh | p. 26 |
Configuring zsh | p. 26 |
Summary | p. 26 |
Files and Directories | p. 29 |
Create, Copy, Remove, and Move Files | p. 29 |
Creating Text Files | p. 29 |
Copying Files | p. 30 |
Copy Files with Command Substitution | p. 30 |
Deleting Files | p. 31 |
Moving Files | p. 32 |
The In Command | p. 32 |
The basename, dirname, and file Commands | p. 33 |
The wc Command | p. 33 |
The cat Command | p. 34 |
The more Command and the less Command | p. 34 |
The head Command | p. 35 |
The tail Command | p. 36 |
Comparing File Contents | p. 38 |
The Parts of a Filename | p. 38 |
Working with File Permissions | p. 39 |
The chmod Command | p. 40 |
Changing owner, permissions, and groups | p. 40 |
The umask and ulimit Commands | p. 41 |
Working with Directories | p. 41 |
Absolute and Relative Directories | p. 41 |
Absolute/Relative Pathnames | p. 41 |
Creating Directories | p. 42 |
Removing Directories | p. 43 |
Navigating to Directories | p. 43 |
Moving Directories | p. 44 |
Using Quote Characters | p. 44 |
Streams and Redirection Commands | p. 45 |
Working with Metacharacters | p. 46 |
Working with Character Classes | p. 47 |
Metacharacters and Character Classes | p. 48 |
Digits and Characters | p. 48 |
Working with "^" and "\" and "!" | p. 49 |
Filenames and Metacharacters | p. 49 |
Summary | p. 50 |
Useful Commands | p. 51 |
The join Command | p. 52 |
The fold Command | p. 52 |
The split Command | p. 53 |
The sort Command | p. 53 |
The uniq Command | p. 56 |
How to Compare Files | p. 56 |
The od Command | p. 57 |
The tr Command | p. 57 |
A Simple Use Case | p. 60 |
The find Command | p. 61 |
The tee Command | p. 62 |
File Compression Commands | p. 63 |
The tar command | p. 63 |
The cpio Command | p. 63 |
The gzip and gunzip Commands | p. 64 |
The bunzip2 Command | p. 64 |
The zip Command | p. 65 |
Commands for zip Files and bz Files | p. 65 |
Internal Field Separator (IFS) | p. 65 |
Data From a Range of Columns in a Dataset | p. 66 |
Working with Uneven Rows in Datasets | p. 68 |
Summary | p. 68 |
Conditional Logic and Loops | p. 71 |
Quick Overview of Operators in bash | p. 71 |
Arithmetic Operations and Operators | p. 72 |
The expr Command | p. 72 |
Arithmetic Operators | p. 73 |
Boolean and Numeric Operators | p. 73 |
Compound Operators and Numeric Operators | p. 74 |
Working with Variables | p. 74 |
Assigning Values to Variables | p. 75 |
The read Command for User Input | p. 76 |
Boolean Operators and String Operators | p. 76 |
Compound Operators and String Operators | p. 77 |
File Test Operators | p. 78 |
Compound Operators and File Operators | p. 79 |
Conditional Logic with if /else/fi Statements | p. 80 |
The case/esac Statement | p. 81 |
Working with Strings in Shell Scripts | p. 84 |
Working with Loops | p. 85 |
Using a for loop | p. 85 |
Checking Files in a Directory | p. 86 |
Working with Nested Loops | p. 87 |
Using a while Loop | p. 89 |
The while, case, and if/elif/else/fi Statements | p. 91 |
Using an until Loop | p. 92 |
User-defined Functions | p. 92 |
Creating a Simple Menu from Shell Commands | p. 94 |
Arrays in bash | p. 96 |
Working with Arrays | p. 98 |
Summary | p. 102 |
Filtering Data with grep | p. 103 |
What is the grep Command? | p. 104 |
Metacharacters and the grep Command | p. 105 |
Escaping Metacharacters with the grep Command | p. 105 |
Useful Options for the grep Command | p. 106 |
Character Classes and the grep Command | p. 110 |
Working with the -c Option in grep | p. 111 |
Matching a Range of Lines | p. 112 |
Using Back References in the grep Command | p. 114 |
Finding Empty lines in Datasets | p. 116 |
Using Keys to Search Datasets | p. 116 |
The Backslash Character and the grep Command | p. 117 |
Multiple Matches in the grep Command | p. 117 |
The grep Command and the xargs Command | p. 118 |
Searching zip Files for a String | p. 119 |
Checking for a Unique Key Value | p. 120 |
Redirecting Error Messages | p. 121 |
The egrep Command and fgrep Command | p. 121 |
Displaying "Pure" Words in a Dataset with egrep | p. 121 |
The fgrep Command | p. 123 |
A Simple Use Case | p. 123 |
Summary | p. 125 |
Transforming Data with sed | p. 127 |
What is the sed Command? | p. 127 |
The sed Execution Cycle | p. 128 |
Matching String Patterns Using sed | p. 128 |
Substituting String Patterns Using sed | p. 129 |
Replacing Vowels from a String or a File | p. 130 |
Deleting Multiple Digits and Letters from a String | p. 131 |
Search and Replace with sed | p. 131 |
Datasets with Multiple Delimiters | p. 133 |
Useful Switches in sed | p. 134 |
Working with Datasets | p. 135 |
Printing Lines | p. 135 |
Character Classes and sed | p. 136 |
Removing Control Characters | p. 137 |
Counting Words in a Dataset | p. 137 |
Back References in sed | p. 138 |
Displaying Only "Pure" Words in a Dataset | p. 139 |
One Line sed Commands | p. 140 |
Summary | p. 147 |
Working with awk | p. 149 |
The awk Command | p. 150 |
Built-in Variables That Control awk | p. 150 |
How Does the awk Command Work? | p. 151 |
Aligning Text with the printf Command | p. 152 |
Conditional Logic and Control Statements | p. 152 |
The while Statement | p. 153 |
A for loop in awk | p. 154 |
A for loop with a break Statement | p. 154 |
The next and continue Statements | p. 155 |
Deleting Alternate Lines in Datasets | p. 155 |
Merging Lines in Datasets | p. 156 |
Printing File Contents as a Single Line | p. 156 |
Joining Groups of Lines in a Text File | p. 157 |
Joining Alternate Lines in a Text File | p. 158 |
Matching with Metacharacters and Character Sets | p. 159 |
Printing Lines Using Conditional Logic | p. 160 |
Splitting Filenames with awk | p. 161 |
Working with Postfix Arithmetic Operators | p. 161 |
Numeric Functions in awk | p. 162 |
One Line awk Commands | p. 165 |
Useful Short awk Scripts | p. 166 |
Printing the Words in a Text String in awk | p. 167 |
Count Occurrences of a String in Specific Rows | p. 167 |
Printing a String in a Fixed Number of Columns | p. 169 |
Printing a Dataset in a Fixed Number of Columns | p. 169 |
Aligning Columns in Datasets | p. 170 |
Aligning Columns and Multiple Rows in Datasets | p. 171 |
Removing a Column from a Text File | p. 173 |
Subsets of Columns Aligned Rows in Datasets | p. 173 |
Counting Word Frequency in Datasets | p. 175 |
Displaying Only "Pure" Words in a Dataset | p. 176 |
Working with Multiline Records in awk | p. 178 |
A Simple Use Case | p. 179 |
Another Use Case | p. 181 |
Summary | p. 183 |
Intro to Shell Scripts | p. 185 |
What are Shell Scripts? | p. 186 |
A Simple Shell Script | p. 186 |
Setting Environment Variables via Shell Scripts | p. 187 |
Sourcing or "Dotting" a Shell Script | p. 188 |
Working with Functions in Shell Scripts | p. 189 |
Passing values to Functions in a Shell Script (1) | p. 190 |
Passing values to Functions in a Shell Script (2) | p. 191 |
Iterate through values passed to a Function | p. 192 |
Positional Parameters in User-defined Functions | p. 196 |
Shell Scripts, Functions, and User Input | p. 198 |
Recursion and Shell Scripts | p. 199 |
Iterative Solutions for Factorial Values | p. 200 |
Calculating Fibonacci Numbers | p. 203 |
Calculating the GCD of Two Positive Integers | p. 204 |
Calculating the LCM of two Positive Integers | p. 205 |
Calculating Prime Divisors | p. 207 |
Summary | p. 208 |
Shell Scripts with grep and awk Command | p. 209 |
The grep Command with zip Files | p. 209 |
The grep Command with Multiple Files | p. 212 |
Simulating Relational Data with the grep Command | p. 216 |
Checking Updates in a Logfile | p. 218 |
Processing Multiline Records | p. 220 |
Adding the Contents of Records | p. 221 |
Using the split Function in awk | p. 221 |
Scanning Diagonal Elements in Datasets | p. 222 |
Adding Values From Multiple Datasets (1) | p. 225 |
Adding Values From Multiple Datasets (2) | p. 226 |
Adding Values From Multiple Datasets (3) | p. 228 |
Calculating Combinations of Field Values | p. 229 |
Summary | p. 230 |
Miscellaneous Shell Scripts | p. 231 |
Ushig rm and mv with Directories | p. 231 |
Using the find Command with Directories | p. 233 |
Creating a Directory of Directories | p. 233 |
Cloning a set of Sub-directories | p. 234 |
Executing Files in Multiple Directories | p. 238 |
The case/esac Command | p. 239 |
Compressing/uncompressing Files | p. 241 |
The dd Command | p. 241 |
The crontab Command | p. 242 |
Uncompressing Files as a cron Job | p. 243 |
Scheduled Commands and Background Processes | p. 244 |
How to Schedule Tasks | p. 244 |
The nohup Command | p. 244 |
Executing Commands Remotely | p. 244 |
How to Schedule Tasks in the Background | p. 245 |
How to Terminate Processes | p. 245 |
Terminating Multiple Processes | p. 245 |
Process-Related Commands | p. 246 |
How to Monitor Processes | p. 246 |
Checking Execution Results | p. 247 |
System Messages and Log Files | p. 249 |
Disk Usage Commands | p. 250 |
Trapping and Ignoring Signals | p. 250 |
Arithmetic with the bc and dc Commands | p. 251 |
Working with the date Command | p. 252 |
Print-related Commands | p. 255 |
Creating a Report with the print f () Command | p. 255 |
Checking Updates hi a Logfile | p. 256 |
Listing Active Users on a Machine | p. 258 |
Miscellaneous Commands | p. 259 |
Summary | p. 261 |
Index | p. 263 |
Table of Contents provided by Ingram. All Rights Reserved. |