# Improve Command-line Productivity ## Dennis Kibbe ### Mesa Community College Note: This slide presentation was created using [Reveal.js](https://revealjs.com). You can access a transcript of this presentation by pressing s for speaker notes. You can access navigation help by pressing the question mark key. Audio for this presentation is artificially generated. --- # Module Outline 1. Introduction 1. Learning Objectives 1. Write Simple Bash Scripts 1. Guided Exercise 1. Loops and Conditional Constructs in Scripts 1. Guided Exercise 1. Match Text in Command Output with Regular Expressions 1. Guided Exercise 1. Key Takeaways 1. Resources 1. Graded Lab Note: --- # Learning Objectives *After completing the work in this module you will be able to:* 1. Run commands more efficiently by using advanced features of the Bash shell, shell scripts, and various Red Hat Enterprise Linux utilities. 1. Run repetitive tasks with `for` loops, evaluate exit codes from commands and scripts, run tests with operators, and create conditional structures with `if` statements. 1. Create regular expressions to match data, apply regular expressions to text files with the `grep` command, and use `grep` to search files and data from piped commands. Note: --- # Introduction ## Improve Command-line Productivity Note: --- # Writing Simple Bash Scripts Note: --- # Guided Exercise ## Writing Simple Bash Scripts ![Clipart of two students studying](../images/homework.png) Note: --- # Loops and Conditional Contructs in Scripts Note: --- # Guided Exercise ## Loops and Conditional Constructs in Scripts ![Clipart of two students studying](../images/homework.png) Note: --- # Match Text in Command Output with Regular Expressions Note: --- # Guided Exercise ## Match Text in Command Output with Regular Expressions ![Clipart of two students studying](../images/homework.png) Note: --- # Key Takeaways 1. Create and execute simple Bash scripts to accomplish simple administration tasks. 1. Use loops to iterate through a list of items from the command line and in a shell script 1. Use conditional structures to incorporate decision-making into shell scripts. 1. Search for text in log and configuration files by using regular expressions and the `grep` command. Note: --- # Resources Note: Here are some resources for the topics covered in this chapter. --- # Graded Lab ## Improve Command-line Productivity ![Clipart of technicians in white lab coats](../images/lab_techs.png) Note: --- ![Mesa Community College logo](../images/mcc_logo.png "Mesa Community College") Note: This ends this slide presentation. I hope you found it useful.