Linux command line and shell scripting bible
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 co...
Uloženo v:
| Hlavní autor: | |
|---|---|
| Médium: | E-kniha Kniha |
| Jazyk: | angličtina |
| Vydáno: |
Hoboken
Wiley Pub
2008
John Wiley & Sons, Incorporated Wiley Wiley-Blackwell |
| Vydání: | 3 |
| Edice: | Bible |
| Témata: | |
| ISBN: | 047025128X, 9780470251287, 111898384X, 9781118983843, 1118072286, 9781118072288, 1118004426, 9781118004425 |
| On-line přístup: | Získat plný text |
| Tagy: |
Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
|
Obsah:
- Chapter 10: Working with Editors -- Visiting the vim Editor -- Checking your vim package -- Exploring vim basics -- Editing data -- Copying and pasting -- Searching and substituting -- Navigating the nano Editor -- Exploring the emacs Editor -- Checking your emacs package -- Using emacs on the console -- Exploring the basics of emacs -- Editing data -- Copying and pasting -- Searching and replacing -- Using buffers in emacs -- Using windows in console mode emacs -- Using emacs in a GUI -- Exploring the KDE Family of Editors -- Looking at the KWrite editor -- Looking at the Kate editor -- Exploring the GNOME Editor -- Starting gedit -- Understanding basic gedit features -- Setting preferences -- Setting view preferences -- Setting editor preferences -- Setting font & -- color preferences -- Managing plug-ins -- Summary -- Part II: Shell Scripting Basics -- Chapter 11: Basic Script Building -- Using Multiple Commands -- Creating a Script File -- Displaying Messages -- Using Variables -- Environment variables -- User variables -- Command substitution -- Redirecting Input and Output -- Output redirection -- Input redirection -- Pipes -- Performing Math -- The expr command -- Using brackets -- A floating-point solution -- The basics of bc -- Using bc in scripts -- Exiting the Script -- Checking the exit status -- The exit command -- Summary -- Chapter 12: Using Structured Commands -- Working with the if-then Statement -- Exploring the if-then-else Statement -- Nesting ifs -- Trying the test Command -- Using numeric comparisons -- Using string comparisons -- Looking at string equality -- Looking at string order -- Looking at string size -- Using file comparisons -- Checking directories -- Checking whether an object exists -- Checking for a file -- Checking for read access -- Checking for empty files -- Checking whether you can write to a file
- Redirecting errors and data
- Using the tail command -- Using the head command -- Summary -- Chapter 4: More bash Shell Commands -- Monitoring Programs -- Peeking at the processes -- Unix-style parameters -- BSD-style parameters -- The GNU long parameters -- Real-time process monitoring -- Stopping processes -- The kill command -- The killall command -- Monitoring Disk Space -- Mounting media -- The mount command -- The unmount command -- Using the df command -- Using the du command -- Working with Data Files -- Sorting data -- Searching for data -- Compressing data -- Archiving data -- Summary -- Chapter 5: Understanding the Shell -- Exploring Shell Types -- Exploring Parent and Child Shell Relationships -- Looking at process lists -- Creatively using subshells -- Investigating background mode -- Putting process lists into the background -- Looking at co-processing -- Understanding Shell Built-In Commands -- Looking at external commands -- Looking at built-in commands -- Using the history command -- Using command aliases -- Summary -- Chapter 6: Using Linux Environment Variables -- Exploring Environment Variables -- Looking at global environment variables -- Looking at local environment variables -- Setting User-Defined Variables -- Setting local user-defined variables -- Setting global environment variables -- Removing Environment Variables -- Uncovering Default Shell Environment Variables -- Setting the PATH Environment Variable -- Locating System Environment Variables -- Understanding the login shell process -- Viewing the /etc/profile file -- Viewing the HOME startup files -- Understanding the interactive shell process -- Understanding the non-interactive shell process -- Making environment variables persistent -- Learning about Variable Arrays -- Summary -- Chapter 7: Understanding Linux File Permissions -- Linux Security -- The /etc/passwd file -- The /etc/shadow file
- Adding a new user -- Removing a user -- Modifying a user -- usermod -- passwd and chpasswd -- chsh, chfn, and chage -- 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 8: Managing Filesystems -- Exploring Linux Filesystems -- Understanding the basic Linux filesystems -- Looking at the ext filesystem -- Looking at the ext2 filesystem -- Understanding journaling filesystems -- Looking at the ext3 filesystem -- Looking at the ext4 filesystem -- Looking at the Reiser filesystem -- Looking at the journaled filesystem -- Looking at the XFS filesystem -- Understanding the copy-on-write filesystems -- Looking at the ZFS filesystem -- Looking at the Btrfs filesystem -- Working with Filesystems -- Creating partitions -- Creating a filesystem -- Checking and repairing a filesystem -- Managing Logical Volumes -- Exploring logical volume management layout -- Using the LVM in Linux -- Taking a snapshot -- Striping -- Mirroring -- Using the Linux LVM -- Defining physical volumes -- Creating volume groups -- Creating logical volumes -- Creating the filesystem -- Modifying the LVM -- Summary -- Chapter 9: 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
- Cover -- Title Page -- Copyight -- Contents -- Part I: The Linux Command Line -- Chapter 1: Starting with Linux Shells -- What Is Linux? -- Looking into the Linux kernel -- System memory management -- Software program management -- Hardware management -- Filesystem management -- The GNU utilities -- The core GNU utilities -- The shell -- The Linux desktop environment -- The X Window system -- The KDE desktop -- The GNOME desktop -- The Unity desktop -- Other desktops -- Linux Distributions -- Core Linux distributions -- Specialized Linux distributions -- The Linux LiveCD -- Summary -- Chapter 2: Getting to the Shell -- Reaching the Command Line -- Console terminals -- Graphical terminals -- Accessing CLI via a Linux Console Terminal -- Accessing CLI via Graphical Terminal Emulation -- Using the GNOME Terminal Emulator -- Accessing the GNOME terminal -- The menu bar -- Using the Konsole Terminal Emulator -- Accessing the Konsole terminal -- The menu bar -- Using the xterm Terminal Emulator -- Accessing xterm -- Command line parameters -- Summary -- Chapter 3: Basic bash Shell Commands -- Starting the Shell -- Using the Shell Prompt -- Interacting with the bash Manual -- Navigating the Filesystem -- Looking at the Linux filesystem -- Traversing directories -- Using absolute directory references -- Using relative directory references -- Listing Files and Directories -- Displaying a basic listing -- Displaying a long listing -- Filtering listing output -- Handling Files -- Creating files -- Copying files -- Using tab auto-complete -- Linking files -- Renaming files -- Deleting files -- Managing Directories -- Creating directories -- Deleting directories -- Viewing File Contents -- Viewing the file type -- Viewing the whole file -- Using the cat command -- Using the more command -- Using the less command -- Viewing parts of a file
- Checking whether you can run a file -- Checking ownership -- Checking default group membership -- Checking file date -- Considering Compound Testing -- Working with Advanced if-then Features -- Using double parentheses -- Using double brackets -- Considering the case Command -- Summary -- Chapter 13: 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 -- Breaking out of a single loop -- Breaking out of an inner loop -- Breaking out of an outer loop -- The continue command -- Processing the Output of a Loop -- Practical Examples -- Finding executable files -- Creating multiple user accounts -- Summary -- Chapter 14: Handling User Input -- Passing Parameters -- Reading parameters -- Reading the script name -- Testing parameters -- Using Special Parameter Variables -- Counting parameters -- Grabbing all the data -- Being Shifty -- Working with Options -- Finding your options -- Processing simple options -- Separating options from parameters -- Processing options with values -- Using the getopt command -- Looking at the command format -- Using getopt in your scripts -- Advancing to getopts -- Standardizing Options -- Getting User Input -- Reading basics -- Timing out -- Reading with no display -- Reading from a file -- Summary -- Chapter 15: Presenting Data -- Understanding Input and Output -- Standard file descriptors -- STDIN -- STDOUT -- STDERR -- Redirecting errors -- Redirecting errors only
- Intro -- Command Line and Shell Scripting Bible -- About the Author -- Credits -- Contents at a Glance -- Contents -- Acknowledgments -- Introduction -- Who Should Read This Book -- How This Book Is Organized -- Minimum Requirements -- Where to Go from Here -- Part I: The Linux Command Line -- Chapter 1: Starting with Linux Shells -- What Is Linux? -- Linux Distributions -- Summary -- Chapter 2: Getting to the Shell -- Terminal Emulation -- The terminfo Database -- The Linux Console -- The xterm Terminal -- The Konsole Terminal -- The GNOME Terminal -- Summary -- Chapter 3: Basic bash Shell Commands -- Starting the Shell -- The Shell Prompt -- The bash Manual -- Filesystem Navigation -- File and Directory Listing -- File Handling -- Directory Handling -- Viewing File Contents -- Summary -- Chapter 4: More bash Shell Commands -- Monitoring Programs -- Monitoring Disk Space -- Working with Data Files -- Summary -- Chapter 5: Using Linux Environment Variables -- What Are Environment Variables? -- Setting Environment Variables -- Removing Environment Variables -- Default Shell Environment Variables -- Setting the PATH Environment Variable -- Locating System Environment Variables -- Variable Arrays -- Using Command Aliases -- Summary -- Chapter 6: Understanding Linux File Permissions -- Linux Security -- Using Linux Groups -- Decoding File Permissions -- Changing Security Settings -- Sharing Files -- Summary -- Chapter 7: Working with Editors -- The vim Editor -- The emacs Editor -- The KDE Family of Editors -- The GNOME Editor -- Summary -- Part II: Shell Scripting Basics -- Chapter 8: Basic Script Building -- Using Multiple Commands -- Creating a Script File -- Displaying Messages -- Using Variables -- Redirecting Input and Output -- Pipes -- Performing Math -- Exiting the Script -- Summary -- Chapter 9: Using Structured Commands
- Working with the if-then Statement -- The if-then-else Statement -- Nesting ifs -- The test Command -- Compound Condition Testing -- Advanced if-then Features -- The case Command -- Summary -- Chapter 10: More Structured Commands -- The for Command -- The C-Style for Command -- The while Command -- The until Command -- Nesting Loops -- Looping on File Data -- Controlling the Loop -- Processing the Output of a Loop -- Summary -- Chapter 11: Handling User Input -- Command Line Parameters -- Special Parameter Variables -- Being Shifty -- Working With Options -- Standardizing Options -- Getting User Input -- Summary -- Chapter 12: Presenting Data -- Understanding Input and Output -- Redirecting Output in Scripts -- Redirecting Input in Scripts -- Creating Your Own Redirection -- Listing Open File Descriptors -- Suppressing Command Output -- Using Temporary Files -- Logging Messages -- Summary -- Chapter 13: Script Control -- Handling Signals -- Running Scripts in Background Mode -- Running Scripts without a Console -- Job Control -- Being Nice -- Running Like Clockwork -- Start At the Beginning -- Summary -- Part III: Advanced Shell Scripting -- Chapter 14: Creating Functions -- Basic Script Functions -- Returning a Value -- Using Variables in Functions -- Array Variables and Functions -- Function Recursion -- Creating a Library -- Using Functions on the Command Line -- Summary -- Chapter 15: Adding Color to Scripts -- Creating Text Menus -- Adding Color -- Doing Windows -- Getting Graphic -- Summary -- Chapter 16: Introducing sed and gawk -- Text Manipulation -- The sed Editor Basics -- Summary -- Chapter 17: Regular Expressions -- What Are Regular Expressions? -- Defining BRE Patterns -- Extended Regular Expressions -- Regular Expressions in Action -- Summary -- Chapter 18: Advanced sed -- Multiline Commands -- The Hold Space -- Negating a Command
- Changing the Flow -- Pattern Replacement -- Using sed in Scripts -- Creating sed Utilities -- Summary -- Chapter 19: Advanced gawk -- Using Variables -- Working with Arrays -- Using Patterns -- Structured Commands -- Formatted Printing -- Built-in Functions -- User-Defined Functions -- Summary -- Part IV: Alternative Linux Shells -- Chapter 20: The ash Shell -- What Is the ash Shell? -- The Original ash Shell -- The dash Shell -- Scripting in dash -- Summary -- Chapter 21: The tcsh Shell -- What Is the tcsh Shell? -- The tcsh Shell Components -- Scripting in tcsh -- Summary -- Chapter 22: The Korn Shell -- The Korn Shell History -- The Parts of the ksh93 Shell -- Scripting in the ksh93 Shell -- Summary -- Chapter 23: The zsh Shell -- History of the zsh Shell -- Parts of the zsh Shell -- Scripting with zsh -- Summary -- Part V: Advanced Topics -- Chapter 24: Using a Database -- The MySQL Database -- The PostgreSQL Database -- Working with Tables -- Using the Database in Your Scripts -- Summary -- Chapter 25: Using the Web -- The Lynx Program -- The cURL Program -- Networking with zsh -- Summary -- Chapter 26: Using E-Mail -- The Basics of Linux E-Mail -- Setting Up Your Server -- Sending a Message with Mailx -- The Mutt Program -- Summary -- Chapter 27: Shell Scripts for Administrators -- Monitoring System Statistics -- Performing Backups -- 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 -- The gawk program -- Appendix C: Comparing Shells -- Variables -- Structured Commands -- Mathematical Operations -- Index
- 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
- Intro -- 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
- The Multiline print Command
- 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

