Details

Linux Command Line and Shell Scripting Bible


Linux Command Line and Shell Scripting Bible


Bible 4. Aufl.

von: Richard Blum, Christine Bresnahan

33,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 16.12.2020
ISBN/EAN: 9781119700944
Sprache: englisch
Anzahl Seiten: 832

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>Advance your understanding of the Linux command line with this invaluable resource </b></p> <p><i>Linux Command Line and Shell Scripting Bible, 4th Edition</i> is the newest installment in the indispensable series known to Linux developers all over the world. Packed with concrete strategies and practical tips, the latest edition includes brand-new content covering:</p> <ul> <li>Understanding the Shell  </li> <li>Writing Simple Script Utilities  </li> <li>Producing Database, Web & Email Scripts  </li> <li>Creating Fun Little Shell Scripts </li> </ul> <p>Written by accomplished Linux professionals Christine Bresnahan and Richard Blum, Linux Command Line and Shell Scripting Bible, 4th Edition teaches readers the fundamentals and advanced topics necessary for a comprehensive understanding of shell scripting in Linux. The book is filled with real-world examples and usable scripts, helping readers navigate the challenging Linux environment with ease and convenience. </p> <p>The book is perfect for anyone who uses Linux at home or in the office and will quickly find a place on every Linux enthusiast’s bookshelf.</p>
<p>Acknowledgments xi</p> <p><b>Part I: The Linux Command Line 1</b></p> <p><b>Chapter 1: Starting with Linux Shells 3</b></p> <p>Investigating Linux 3</p> <p>Looking into the Linux kernel 4</p> <p>System memory management 5</p> <p>Software program management 6</p> <p>Hardware management 8</p> <p>Filesystem management 8</p> <p>The GNU utilities 9</p> <p>The core GNU utilities 10</p> <p>The shell 10</p> <p>The Linux desktop environment 11</p> <p>The X Window software 12</p> <p>The KDE Plasma desktop 12</p> <p>The GNOME desktop 13</p> <p>Other desktops 15</p> <p>Examining Linux Distributions 17</p> <p>Core Linux distributions 18</p> <p>Specialized Linux distributions 19</p> <p>Summary 20</p> <p><b>Chapter 2: Getting to the Shell 21</b></p> <p>Reaching the Command Line 21</p> <p>Console terminals 22</p> <p>Graphical terminals 22</p> <p>Accessing CLI via a Linux Console Terminal 23</p> <p>Accessing CLI via Graphical Terminal Emulation 26</p> <p>Using the GNOME Terminal Emulator 27</p> <p>Accessing GNOME Terminal 27</p> <p>The menu bar 32</p> <p>Using the Konsole Terminal Emulator 36</p> <p>Accessing Konsole 36</p> <p>The menu bar 38</p> <p>Using the xterm Terminal Emulator 42</p> <p>Accessing xterm 43</p> <p>Command-line parameters 44</p> <p>Summary 45</p> <p><b>Chapter 3: Basic Bash Shell Commands 47</b></p> <p>Starting the Shell 47</p> <p>Using the Shell Prompt 48</p> <p>Interacting with the Bash Manual 49</p> <p>Navigating the Filesystem 53</p> <p>Looking at the Linux filesystem 53</p> <p>Traversing directories 57</p> <p>Using absolute directory references 57</p> <p>Using relative directory references 59</p> <p>Listing Files and Directories 60</p> <p>Displaying a basic listing 61</p> <p>Displaying a long listing 63</p> <p>Filtering listing output 64</p> <p>Handling Files 66</p> <p>Creating files 66</p> <p>Copying files 66</p> <p>Using command-line completion 69</p> <p>Linking files 69</p> <p>Renaming files 71</p> <p>Deleting files 73</p> <p>Managing Directories 74</p> <p>Creating directories 74</p> <p>Deleting directories 75</p> <p>Viewing File Contents 77</p> <p>Viewing the file type 77</p> <p>Viewing the whole file 78</p> <p>Using the <i>cat </i>command 78</p> <p>Using the <i>more </i>command 78</p> <p>Using the <i>less </i>command 80</p> <p>Viewing parts of a file 80</p> <p>Using the <i>tail </i>command 80</p> <p>Using the <i>head </i>command 82</p> <p>Summary 82</p> <p><b>Chapter 4: More Bash Shell Commands 85</b></p> <p>Monitoring Programs 85</p> <p>Peeking at the processes 85</p> <p>Unix-style parameters 86</p> <p>BSD-style parameters 89</p> <p>The GNU long parameters 91</p> <p>Real-time process monitoring 93</p> <p>Stopping processes 95</p> <p>The kill command 95</p> <p>The pkill command 96</p> <p>Monitoring Disk Space 96</p> <p>Mounting media 97</p> <p>The <i>mount </i>command 97</p> <p>The <i>umount </i>command 99</p> <p>Using the <i>df </i>command 100</p> <p>Using the <i>du </i>command 101</p> <p>Working with Data Files 102</p> <p>Sorting data 102</p> <p>Searching for data 106</p> <p>Compressing data 108</p> <p>Archiving data 109</p> <p>Summary 111</p> <p><b>Chapter 5: Understanding the Shell 113</b></p> <p>Investigating Shell Types 113</p> <p>Exploring Parent and Child Shell Relationships 117</p> <p>Looking at process lists 121</p> <p>Creatively using subshells 123</p> <p>Investigating background mode 123</p> <p>Putting process lists into the background 125</p> <p>Looking at co-processing 126</p> <p>Understanding External and Built-In Commands 127</p> <p>Looking at external commands 128</p> <p>Looking at built-in commands 129</p> <p>Using the <i>history </i>command 130</p> <p>Using command aliases 134</p> <p>Summary 135</p> <p><b>Chapter 6: Using Linux Environment Variables 137</b></p> <p>Exploring Environment Variables 137</p> <p>Looking at global environment variables 138</p> <p>Looking at local environment variables 140</p> <p>Setting User-Defined Variables 141</p> <p>Setting local user-defined variables 141</p> <p>Setting global environment variables 142</p> <p>Removing Environment Variables 144</p> <p>Uncovering Default Shell Environment Variables 145</p> <p>Setting the <i>PATH </i>Environment Variable 150</p> <p>Locating System Environment Variables 152</p> <p>Understanding the login shell process 152</p> <p>Viewing the <i>/etc/profi le file </i>152</p> <p>Viewing the <i>$HOME </i>startup files 156</p> <p>Understanding the interactive shell process 157</p> <p>Understanding the noninteractive shell process 158</p> <p>Making environment variables persistent 159</p> <p>Learning about Variable Arrays 159</p> <p>Summary 161</p> <p><b>Chapter 7: Understanding Linux File Permissions 163</b></p> <p>Exploring Linux Security 163</p> <p>The <i>/etc/passwd file </i>164</p> <p>The <i>/etc/shadow file </i>165</p> <p>Adding a new user 166</p> <p>Removing a user 169</p> <p>Modifying a user 169</p> <p><i>usermod </i>170</p> <p><i>passwd </i>and <i>chpasswd </i>170</p> <p><i>chsh</i>, <i>chfn</i>, and <i>chage </i>171</p> <p>Using Linux Groups 173</p> <p>The <i>/etc/group file </i>173</p> <p>Creating new groups 174</p> <p>Modifying groups 175</p> <p>Decoding File Permissions 176</p> <p>Using file permission symbols 176</p> <p>Default file permissions 178</p> <p>Changing Security Settings 179</p> <p>Changing permissions 180</p> <p>Changing ownership 181</p> <p>Sharing Files 182</p> <p>Access Control Lists 184</p> <p>Summary 186</p> <p><b>Chapter 8: Managing Filesystems 189</b></p> <p>Exploring Linux Filesystems 189</p> <p>Exploring the Linux filesystem evolution 190</p> <p>Looking at the ext filesystem 190</p> <p>Looking at the ext2 filesystem 190</p> <p>Digging into journaling filesystems 191</p> <p>Looking at the ext3 filesystem 191</p> <p>Looking at the ext4 filesystem 191</p> <p>Looking at the JFS filesystem 192</p> <p>Looking at ReiserFS 192</p> <p>Looking at XFS 192</p> <p>Understanding the volume-managing filesystems 192</p> <p>Looking at the ZFS filesystem 193</p> <p>Looking at the Btrfs filesystem 193</p> <p>Looking at the Stratis filesystem 193</p> <p>Working with Filesystems 194</p> <p>Creating partitions 194</p> <p>Looking at the <i>fdisk </i>utility 194</p> <p>Working with <i>gdisk </i>197</p> <p>The GNU <i>parted </i>command 198</p> <p>Creating a filesystem 199</p> <p>Checking and repairing a filesystem 201</p> <p>Managing Logical Volumes 202</p> <p>Exploring LVM layout 203</p> <p>Physical volume 203</p> <p>Volume group 203</p> <p>Logical volume 203</p> <p>Understanding the LVM in Linux 203</p> <p>Create the PVs 204</p> <p>Create a VG 204</p> <p>Create an LV 205</p> <p>Using the Linux LVM 206</p> <p>Format and mount an LV 206</p> <p>Growing or shrinking your VGs and LVs 206</p> <p>Summary 207</p> <p><b>Chapter 9: Installing Software 209</b></p> <p>Exploring Package Management 209</p> <p>Inspecting the Debian-Based Systems 210</p> <p>Managing packages with <i>apt </i>211</p> <p>Installing software packages with <i>apt </i>213</p> <p>Upgrading software with <i>apt </i>215</p> <p>Uninstalling software with <i>apt </i>216</p> <p>The <i>apt </i>repositories 218</p> <p>The Red Hat–Based Systems 220</p> <p>Listing installed packages 220</p> <p>Installing software with <i>dnf </i>221</p> <p>Upgrading software with <i>dnf </i>223</p> <p>Uninstalling software with <i>dnf </i>223</p> <p>Dealing with broken dependencies 223</p> <p>RPM repositories 224</p> <p>Managing Software Using Containers 225</p> <p>Using snap containers 225</p> <p>Using flatpak containers 227</p> <p>Installing from Source Code 229</p> <p>Summary 232</p> <p><b>Chapter 10: Working with Editors 235</b></p> <p>Visiting the vim Editor 235</p> <p>Checking your vim package 236</p> <p>Exploring vim basics 237</p> <p>Editing data 240</p> <p>Copying and pasting 240</p> <p>Searching and substituting 241</p> <p>Navigating the nano Editor 242</p> <p>Exploring the Emacs Editor 244</p> <p>Checking your Emacs package 245</p> <p>Using Emacs on the console 246</p> <p>Exploring the basics of Emacs 247</p> <p>Editing data 248</p> <p>Copying and pasting 249</p> <p>Searching and replacing 249</p> <p>Using buffers in Emacs 250</p> <p>Using windows in console mode Emacs 251</p> <p>Using Emacs in a GUI 252</p> <p>Exploring the KDE Family of Editors 253</p> <p>Looking at the KWrite editor 253</p> <p>Looking at the Kate editor 259</p> <p>Exploring the GNOME Editor 263</p> <p>Starting gedit 264</p> <p>Understanding basic gedit features 265</p> <p>Managing plugins 268</p> <p>Summary 271</p> <p><b>Part II: Shell Scripting Basics 273</b></p> <p><b>Chapter 11: Basic Script Building 275</b></p> <p>Using Multiple Commands 275</p> <p>Creating a Script File 276</p> <p>Displaying Messages 278</p> <p>Using Variables 279</p> <p>Environment variables 280</p> <p>User variables 281</p> <p>Command substitution 283</p> <p>Redirecting Input and Output 284</p> <p>Output redirection 285</p> <p>Input redirection 285</p> <p>Employing Pipes 287</p> <p>Performing Math 289</p> <p>The <i>expr </i>command 290</p> <p>Using brackets 292</p> <p>A floating-point solution 293</p> <p>The basics of <i>bc </i>293</p> <p>Using <i>bc </i>in scripts 295</p> <p>Exiting the Script 297</p> <p>Checking the exit status 297</p> <p>The <i>exit </i>command 298</p> <p>Working through a Practical Example 300</p> <p>Summary 301</p> <p><b>Chapter 12: Using Structured Commands 303</b></p> <p>Working with the <i>if-then </i>Statement 303</p> <p>Exploring the <i>if-then-else </i>Statement 306</p> <p>Nesting <i>if</i>s 307</p> <p>Trying the <i>test </i>Command 311</p> <p>Using numeric comparisons 313</p> <p>Using string comparisons 314</p> <p>Looking at string equality 315</p> <p>Looking at string order 316</p> <p>Looking at string size 318</p> <p>Using file comparisons 320</p> <p>Checking directories 320</p> <p>Checking whether an object exists 321</p> <p>Checking for a file 322</p> <p>Checking for read access 324</p> <p>Checking for empty files 325</p> <p>Checking whether you can write to a file 326</p> <p>Checking whether you can run a file 327</p> <p>Checking ownership 328</p> <p>Checking default group membership 329</p> <p>Checking file date 330</p> <p>Considering Compound Testing 331</p> <p>Working with Advanced <i>if-then </i>Features 332</p> <p>Using single parentheses 332</p> <p>Using double parentheses 333</p> <p>Using double brackets 335</p> <p>Considering the <i>case </i>Command 335</p> <p>Working through a Practical Example 337</p> <p>Summary 343</p> <p><b>Chapter 13: More Structured Commands 345</b></p> <p>Looking at the <i>for </i>Command 345</p> <p>Reading values in a list 346</p> <p>Reading complex values in a list 347</p> <p>Reading a list from a variable 349</p> <p>Reading values from a command 350</p> <p>Changing the field separator 351</p> <p>Reading a directory using wildcards 352</p> <p>Trying the C-Style <i>for </i>Command 354</p> <p>The C language <i>for </i>command 355</p> <p>Using multiple variables 356</p> <p>Exploring the <i>while </i>Command 357</p> <p>Basic <i>while </i>format 357</p> <p>Using multiple test commands 358</p> <p>Using the <i>until </i>Command 359</p> <p>Nesting Loops 361</p> <p>Looping on File Data 364</p> <p>Controlling the Loop 365</p> <p>The <i>break </i>command 365</p> <p>Breaking out of a single loop 365</p> <p>Breaking out of an inner loop 366</p> <p>Breaking out of an outer loop 367</p> <p>The <i>continue </i>command 368</p> <p>Processing the Output of a Loop 371</p> <p>Working through a Few Practical Examples 372</p> <p>Finding executable files 373</p> <p>Creating multiple user accounts 374</p> <p>Summary 375</p> <p><b>Chapter 14: Handling User Input 377</b></p> <p>Passing Parameters 377</p> <p>Reading parameters 377</p> <p>Reading the script name 380</p> <p>Testing parameters 381</p> <p>Using Special Parameter Variables 382</p> <p>Counting parameters 382</p> <p>Grabbing all the data 384</p> <p>Being Shifty 386</p> <p>Working with Options 388</p> <p>Finding your options 388</p> <p>Processing simple options 388</p> <p>Separating options from parameters 389</p> <p>Processing options with values 391</p> <p>Using the <i>getopt </i>command 392</p> <p>Looking at the command format 392</p> <p>Using <i>getopt </i>in your scripts 393</p> <p>Advancing to <i>getopts </i>395</p> <p>Standardizing Options 398</p> <p>Getting User Input 399</p> <p>Reading basics 399</p> <p>Timing Out 401</p> <p>Reading with no display 402</p> <p>Reading from a file 403</p> <p>Working through a Practical Example 404</p> <p>Summary 408</p> <p><b>Chapter 15: Presenting Data 411</b></p> <p>Understanding Input and Output 411</p> <p>Standard file descriptors 412</p> <p>STDIN 412</p> <p>STDOUT 413</p> <p>STDERR 414</p> <p>Redirecting errors 414</p> <p>Redirecting errors only 414</p> <p>Redirecting errors and data 415</p> <p>Redirecting Output in Scripts 416</p> <p>Temporary redirections 416</p> <p>Permanent redirections 417</p> <p>Redirecting Input in Scripts 418</p> <p>Creating Your Own Redirection 419</p> <p>Creating output file descriptors 419</p> <p>Redirecting file descriptors 420</p> <p>Creating input file descriptors 421</p> <p>Creating a read/write file descriptor 422</p> <p>Closing file descriptors 423</p> <p>Listing Open File Descriptors 424</p> <p>Suppressing Command Output 426</p> <p>Using Temporary Files 427</p> <p>Creating a local temporary file 427</p> <p>Creating a temporary file in <i>/</i>tmp 428</p> <p>Creating a temporary directory 429</p> <p>Logging Messages 430</p> <p>Working through a Practical Example 431</p> <p>Summary 433</p> <p><b>Chapter 16: Script Control 435</b></p> <p>Handling Signals 435</p> <p>Signaling the Bash shell 435</p> <p>Generating signals 436</p> <p>Interrupting a process 436</p> <p>Pausing a process 437</p> <p>Trapping signals 438</p> <p>Trapping a script exit 440</p> <p>Modifying or removing a trap 441</p> <p>Running Scripts in Background Mode 443</p> <p>Running in the background 443</p> <p>Running multiple background jobs 445</p> <p>Running Scripts without a Hang-up 447</p> <p>Controlling the Job 448</p> <p>Viewing jobs 448</p> <p>Restarting stopped jobs 450</p> <p>Being Nice 451</p> <p>Using the <i>nice </i>command 452</p> <p>Using the <i>renice </i>command 453</p> <p>Running <i>like </i>Clockwork 454</p> <p>Scheduling a job using the <i>at </i>command 454</p> <p>Understanding the <i>at </i>command format 454</p> <p>Retrieving job output 455</p> <p>Listing pending jobs 457</p> <p>Removing jobs 457</p> <p>Scheduling regular scripts 458</p> <p>Looking at the <i>cron </i>table 458</p> <p>Building the <i>cron </i>table 459</p> <p>Viewing <i>cron </i>directories 460</p> <p>Looking at the <i>anacron </i>program 460</p> <p>Starting scripts with a new shell 462</p> <p>Working through a Practical Example 463</p> <p>Summary 469</p> <p><b>Part III: Advanced Shell Scripting 471</b></p> <p><b>Chapter 17: Creating Functions 473</b></p> <p>Exploring Basic Script Functions 473</p> <p>Creating a function 474</p> <p>Using functions 474</p> <p>Returning a Value from a Function 477</p> <p>The default exit status 477</p> <p>Using the <i>return </i>command 478</p> <p>Using function output 479</p> <p>Using Variables in Functions 480</p> <p>Passing parameters to a function 480</p> <p>Handling variables in a function 482</p> <p>Global variables 483</p> <p>Local variables 484</p> <p>Investigating Array Variables and Functions 485</p> <p>Passing arrays to functions 485</p> <p>Returning arrays from functions 487</p> <p>Considering Function Recursion 488</p> <p>Creating a Library 489</p> <p>Using Functions on the Command Line 491</p> <p>Creating functions on the command line 491</p> <p>Defining functions in the <i>bashrc file </i>492</p> <p>Directly defining functions 492</p> <p>Sourcing function files 493</p> <p>Working Through a Practical Example 494</p> <p>Downloading and installing 494</p> <p>Building the library 495</p> <p>The shtool library functions 496</p> <p>Using the library 497</p> <p>Summary 497</p> <p><b>Chapter 18: Writing Scripts for Graphical Desktops 499</b></p> <p>Creating Text Menus 499</p> <p>Create the menu layout 499</p> <p>Create the menu functions 501</p> <p>Add the menu logic 502</p> <p>Putting it all together 502</p> <p>Using the <i>select </i>command 504</p> <p>Doing Windows 505</p> <p>The dialog package 506</p> <p>The <i>msgbox </i>widget 507</p> <p>The <i>yesno </i>widget 508</p> <p>The <i>inputbox </i>widget 508</p> <p>The <i>textbox </i>widget 510</p> <p>The <i>menu </i>widget 511</p> <p>The <i>fselect </i>widget 512</p> <p>The <i>dialog </i>options 513</p> <p>Using the <i>dialog </i>command in a script 515</p> <p>Getting Graphic 516</p> <p>The KDE environment 517</p> <p>kdialog widgets 517</p> <p>Using kdialog 519</p> <p>The GNOME environment 521</p> <p>zenity Widgets 521</p> <p>Using zenity in scripts 523</p> <p>Working Through a Practical Example 525</p> <p>Summary 529</p> <p><b>Chapter 19: Introducing <i>sed </i>and <i>gawk </i>531</b></p> <p>Manipulating Text 531</p> <p>Getting to know the <i>sed </i>editor 532</p> <p>Defining an editor command in the command line 533</p> <p>Using multiple editor commands in the command line 534</p> <p>Reading editor commands from a file 534</p> <p>Getting to know the <i>gawk </i>program 535</p> <p>Visiting the <i>gawk </i>command format 536</p> <p>Reading the program script from the command line 536</p> <p>Using data field variables 537</p> <p>Using multiple commands in the program script 538</p> <p>Reading the program from a file 539</p> <p>Running scripts before processing data 539</p> <p>Running scripts after processing data 540</p> <p>Looking at the <i>sed </i>Editor Basic Commands 542</p> <p>Introducing more substitution options 542</p> <p>Substituting flags 542</p> <p>Replacing characters 543</p> <p>Using addresses 544</p> <p>Addressing the numeric line 544</p> <p>Using text pattern filters 545</p> <p>Grouping commands 546</p> <p>Deleting lines 547</p> <p>Inserting and appending text 549</p> <p>Changing lines 551</p> <p>Transforming characters 552</p> <p>Printing revisited 553</p> <p>Printing lines 554</p> <p>Printing line numbers 555</p> <p>Listing lines 555</p> <p>Using files with <i>sed </i>556</p> <p>Writing to a file 556</p> <p>Reading data from a file 557</p> <p>Working Through a Practical Example 559</p> <p>Summary 564</p> <p><b>Chapter 20: Regular Expressions 565</b></p> <p>Exploring Regular Expressions 565</p> <p>A definition 565</p> <p>Types of regular expressions 567</p> <p>Defining BRE Patterns 567</p> <p>Plain text 567</p> <p>Special characters 569</p> <p>Anchor characters 570</p> <p>Starting at the beginning 570</p> <p>Looking for the ending 571</p> <p>Combining anchors 572</p> <p>The dot character 572</p> <p>Character classes 573</p> <p>Negating character classes 575</p> <p>Using ranges 576</p> <p>Special character classes 577</p> <p>The asterisk 578</p> <p>Trying Out Extended Regular Expressions 579</p> <p>The question mark 579</p> <p>The plus sign 580</p> <p>Using braces 581</p> <p>The pipe symbol 582</p> <p>Grouping expressions 583</p> <p>Working Through Some Practical Examples 584</p> <p>Counting directory files 584</p> <p>Validating a phone number 585</p> <p>Parsing an email address 587</p> <p>Summary 589</p> <p><b>Chapter 21: Advanced <i>sed </i>591</b></p> <p>Looking at Multiline Commands 591</p> <p>Navigating the next command 592</p> <p>Using the single-line next command 592</p> <p>Combining lines of text 593</p> <p>Navigating the multiline delete command 595</p> <p>Navigating the multiline print command 596</p> <p>Holding Space 598</p> <p>Negating a Command 599</p> <p>Changing the Flow 602</p> <p>Branching 603</p> <p>Testing 605</p> <p>Replacing via a Pattern 606</p> <p>Using the ampersand 606</p> <p>Replacing individual words 607</p> <p>Placing <i>sed </i>Commands in Scripts 608</p> <p>Using wrappers 608</p> <p>Redirecting <i>sed </i>output 609</p> <p>Creating <i>sed </i>Utilities 610</p> <p>Spacing with double lines 610</p> <p>Spacing files that may have blanks 611</p> <p>Numbering lines in a file 612</p> <p>Printing last lines 613</p> <p>Deleting lines 614</p> <p>Deleting consecutive blank lines 615</p> <p>Deleting leading blank lines 616</p> <p>Deleting trailing blank lines 616</p> <p>Removing HTML tags 617</p> <p>Working Through a Practical Example 619</p> <p>Summary 624</p> <p><b>Chapter 22: Advanced <i>gawk k </i>627</b></p> <p>Using Variables 627</p> <p>Built-in variables 628</p> <p>The field and record separator variables 628</p> <p>Data variables 631</p> <p>User-defined variables 634</p> <p>Assigning variables in scripts 634</p> <p>Assigning variables on the command line 635</p> <p>Working with Arrays 636</p> <p>Defining array variables 636</p> <p>Iterating through array variables 637</p> <p>Deleting array variables 638</p> <p>Considering Patterns 638</p> <p>Regular expressions 639</p> <p>The matching operator 639</p> <p>Mathematical expressions 640</p> <p>Structured Commands 641</p> <p>The <i>if </i>statement 641</p> <p>The <i>while </i>statement 643</p> <p>The <i>do-while </i>statement 644</p> <p>The <i>for </i>statement 645</p> <p>Printing with Formats 645</p> <p>Using Built-in Functions 648</p> <p>Mathematical functions 649</p> <p>String functions 650</p> <p>Time functions 652</p> <p>Trying Out User-Defined Functions 653</p> <p>Defining a function 653</p> <p>Using your functions 654</p> <p>Creating a function library 654</p> <p>Working Through a Practical Example 655</p> <p>Summary 657</p> <p><b>Chapter 23: Working with Alternative Shells 659</b></p> <p>Considering the Dash Shell 659</p> <p>Looking at the Dash Shell Features 661</p> <p>The Dash command-line parameters 661</p> <p>The Dash environment variables 662</p> <p>Default environment variables 662</p> <p>Positional parameters 663</p> <p>User-defined environment variables 663</p> <p>The Dash built-in commands 664</p> <p>Scripting in Dash 665</p> <p>Creating Dash scripts 665</p> <p>Things that won’t work 665</p> <p>Using arithmetic 666</p> <p>The <i>test </i>command 666</p> <p>The <i>function </i>command 667</p> <p>Exploring the zsh Shell 668</p> <p>Viewing Parts of the zsh shell 668</p> <p>Shell options 669</p> <p>Built-in commands 670</p> <p>Core built-in commands 670</p> <p>Add-in modules 673</p> <p>Viewing, adding, and removing modules 673</p> <p>Scripting with zsh 674</p> <p>Mathematical operations 674</p> <p>Performing calculations 674</p> <p>Mathematical functions 675</p> <p>Structured commands 676</p> <p>Functions 677</p> <p>Working Through a Practical Example 677</p> <p>Summary 678</p> <p><b>Part IV: Creating and Managing Practical Scripts 679</b></p> <p><b>Chapter 24: Writing Simple Script Utilities 681</b></p> <p>Performing Backups 681</p> <p>Backing up files daily 682</p> <p>Obtaining the required functions 682</p> <p>Creating a daily archive location 685</p> <p>Creating a daily backup script 686</p> <p>Running the daily archive script 688</p> <p>Creating an hourly archive script 689</p> <p>Running the hourly archive script 692</p> <p>Managing Account Deletion 693</p> <p>Obtaining the required functions 693</p> <p>Getting the correct account name 693</p> <p>Creating a function to get the correct account name 695</p> <p>Verifying the entered account name 696</p> <p>Determining whether the account exists 698</p> <p>Removing any account processes 699</p> <p>Finding account files 702</p> <p>Removing the account 702</p> <p>Creating the script 703</p> <p>Running the script 708</p> <p>Monitoring Your System 710</p> <p>Obtaining the default shell audit functions 710</p> <p>Obtaining the permission audit functions 714</p> <p>Creating the script 716</p> <p>Running the script 719</p> <p>Summary 721</p> <p><b>Chapter 25: Getting Organized 723</b></p> <p>Understanding Version Control 723</p> <p>Working directory 724</p> <p>Staging area 725</p> <p>Looking at the local repository 725</p> <p>Exploring a remote repository 726</p> <p>Branching 726</p> <p>Cloning 726</p> <p>Using Git for VCS 727</p> <p>Setting Up Your Git Environment 727</p> <p>Committing with Git 732</p> <p>Summary 739</p> <p>Appendix A: Quick Guide to Bash Commands 741</p> <p>Appendix B: Quick Guide to <i>sed </i>and <i>gawk </i>755</p> <p>Index 767</p>
<p><b>RICHARD BLUM</b> has over three decades of experience working as a system and network administrator. He is the author of several Linux books and is an accomplished online Linux instructor.</p> <p><b>CHRISTINE BRESNAHAN</b> is an Adjunct Professor at Ivy Tech Community College where she teaches Linux certification and Python classes. She is the author of several Linux books, including the <i>CompTIA Linux+ Study Guide</i>, Fourth Edition.</p>
<p><b>Become proficient in the Linux Shell with this indispensable and approachable resource</b> <p>Newly revised and comprehensively updated, the Fourth Edition of <i>Linux Command Line and Shell Scripting Bible</i> provides readers with accessible instruction on the basic and advanced topics they'll need to learn and master Linux shell scripting. Accomplished authors Richard Blum and Christine Bresnahan walk you through real-world Linux environments using new functional script examples. <p>You'll learn how to write simple script utilities, as well as how to produce advanced scripts using sed, gawk, and regular expressions. Discover how to get started with Linux using various distributions, how to issue basic commands, use Linux environment variables, and understand Linux file permissions. The book also teaches you how to install software and work with Linux Shell script editors like vim, nano, and emacs. <p>Perfect for Linux system administrators seeking tutorials on how to write and use shell scripts or a quick reference book for commands and procedures. <i>Linux Command Line and Shell Scripting Bible</i> also belongs on the bookshelves of Linux enthusiasts who want to dig deeper into their favorite operating system. <p>Written in an approachable and jargon-free style designed to help you get the most out of your Linux Shell scripting experience, this book will teach you how to: <ul> <li><b>Create and manage practical scripts, including how to write script utilities</b></li> <li><b>Work with alternative shells, like dash and zsh</b></li> <li><b>Make the best use of the gawk and sed editors</b></li> <li><b>Use and define regular and extended regular expressions</b></li> <li><b>Write Linux Shell scripts for graphical desktops in both KDE and GNOME</b></li> <li><b>Create basic and advanced functions</b></li> </ul>

Diese Produkte könnten Sie auch interessieren:

Windows Vista For Dummies
Windows Vista For Dummies
von: Andy Rathbone
PDF ebook
15,99 €
Mastering Digital Audio Production
Mastering Digital Audio Production
von: Cliff Truesdell
PDF ebook
26,99 €