Course duration
- 2 days
Course Benefits
- Learn how to avoid errors and save time and money by replacing repetitive work patterns with shell scripts.
Course Outline
- Introduction to the Shell
- Shell Script Strengths and Weaknesses
- Shells
- Switching User Contexts
- Example Shell Script
- Shell and Environment Variables
- Key Environment Variables
- Which and Type
- General Quoting Rules
- Nesting Commands
- Help from Commands and Documentation
- whereis
- Getting Help Within the Graphical Desktop
- Getting Help with man & info
- Lab Tasks
- Shell Variables
- Shell Meta-Characters
- Command Substitution
- Shell Scripting Basics
- Positional Parameters
- Input & Output
- printf
- alias
- Functions
- Colors in Scripts
- Custom Bash Prompts
- Lab Tasks
- Aliases
- Bash Login Scripts
- Create "userinfo" and "sysinfo" functions
- Working with Files
- Communication Channels
- File Redirection
- Piping Commands Together
- Doing Math
- Filesystem Structures
- Determining Disk Usage With df and du
- cron
- The crontab Command
- crontab Format
- /etc/cron.*/ Directories
- Sending Email with mailx
- Lab Tasks
- Disk and Filesystem Usage
- Redirection and Pipes
- Regular Expressions
- Searching Inside Files
- Regular Expression Overview
- Regular Expressions
- RE Character Classes
- Regex Quantifiers
- RE Parenthesis
- The Streaming Editor
- Lab Tasks
- Pattern Matching with Regular Expressions
- Extended Regular Expressions
- Using Regular Expressions With sed
- Branching and Looping
- Exit Status
- Comparisons with test
- Conditional Statements
- Flow Control: case
- Flow Control: while and until Loops
- The borne for-Loop
- Flow Control: select
- Lab Tasks
- Reporting User Statistics
- Monitoring Filesystem Usage
- Data Munging
- Text Processing with Awk
- Text Sorting
- Duplicate Removal Utility
- Extracting Columns of Text
- Lab Tasks
- Create "rmhost" function
- Create "showenv" function
- Parsing Mail Server Logs
- Fixing Incorrect Files
- Security, Whitespace, and Other Gotchas
- Gotcha: Quoting Variables
- Gotcha: Locales
- Gotchas: Maximum Command Length
- Gotcha: Whitespace in for Loops
- Reading Files with while
- Gotcha: $IFS
- Gotcha: Printing in .bashrc
- Gotcha: Aliases
- Lab Tasks
- Renaming MP3 Files
- Split and Display $PATH
- A tar-based Backup
- Challenge
- Apache Configuration Files
- httpd.conf – VirtualHost Configuration
- Lab Tasks
- Automated Virtual Host Provisioning
- Emacs
- Emacs
- The Emacs Interface
- Basic Emacs
- More Emacs Commands
- Lab Tasks
- Text Editing with Emacs
- The Secure Shell (SSH)
- OpenSSH Client & Server Configuration
- Accessing Remote Shells
- Transferring Files
- SSH Key Management
Class Materials
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Experience in the following is required for this Linux class:
- Solid understanding of Unix-based systems and proficiency on the Unix or Linux command line.
Instructor-led courses are offered via a live Web connection, at client sites throughout Europe, and at our Geneva Training Center.