Learning Linux Shell Scripting
1h 27mBeginner2018-05-23
Authors

Troy Miles
Award-winning Software Engineer, Speaker, and Author
Course details
Linux shell scripting is a useful tool for eliminating repetitive, boring tasks. Scripts make many jobs—from programming to system administration—easier, more predictable, and more fun. By the end of this course, even new users will be able to read and create scripts to automate many kinds of tasks in Linux. Instructor Troy Miles first covers the basics of scripting, such as printing to the console and defining variables. Then he shows how to write scripts that accept parameters, read and write files, and monitor other system processes. Plus, find out how to create interactive scripts and handle bad input data.
Learning objectives
Printing to the console
Commenting out scripts
Defining variables and parameters
Creating your first simple script
Branching and loops
Reading environment variables
Reading and writing files
Watching a process
Getting input from users
Handling bad data
Learning objectives
Printing to the console
Commenting out scripts
Defining variables and parameters
Creating your first simple script
Branching and loops
Reading environment variables
Reading and writing files
Watching a process
Getting input from users
Handling bad data
Skills covered
IT AutomationLinuxNetwork AdministrationLearningNetwork and System AdministrationOpen Source
Concepts
0. Introduction
- 01 - Welcome
- 02 - What you should know
1. Shell Scripting Basics
- 03 - Printing to the console
- 04 - chmod
- 05 - Comments
- 06 - The shebang
- 07 - Creating and using variables
- 08 - Passing parameters
- 09 - Challenge - Create a script
- 10 - Solution - Create a script
2. Branching and Loops
- 11 - The if statement
- 12 - The else clause
- 13 - The elif clause
- 14 - The while loop
- 15 - The for loop
- 16 - Using break and continue
- 17 - Challenge - Counter
- 18 - Solution - Counter
3. Environment Variables
- 19 - Reading environment variables
- 20 - Standard environment variables
- 21 - Challenge - Display a variable
- 22 - Solution - Display a variable
4. Functions
- 23 - The basics of functions
- 24 - Using parameters
- 25 - Piping
- 26 - Challenge - Pipes and functions
- 27 - Solution - Pipes and functions
5. File Operations
- 28 - Reading files
- 29 - Writing files
- 30 - File checksums
- 31 - Challenge - Read a text file
- 32 - Solution - Read a text file
6. Sleep and Process
- 33 - Using the sleep command
- 34 - Watching a process
- 35 - Challenge - Watch a script
- 36 - Solution - Watch a script
7. Interactive Scripts
- 37 - Getting input from users
- 38 - Handling bad data
- 39 - Challenge - Guessing game
- 40 - Solution - Guessing game
Conclusion
- 41 - Next steps
Related courses
- Linux Bash Shells and Scripts: Streamlining Tasks and Enhancing Workflows with Automation
- Application Security Testing and Debugging
- Advanced Linux Shell Scripting
- Learning Bash Scripting
- Linux System Engineer: Bash Shell Scripting for Automation
- Linux: Bash Shell and Scripts
- Learning Linux Command Line (2021)
- Ubuntu Linux: Service Configuration
Related learn paths
- Ubuntu Linux Professional Certificate
- Prepare for the Linux Professional Institute LPIC-1 (101-500 and 102-500) Exams
- Explore a Career in Computer Forensics
- The Top Skills IT Professionals Have Right Now
- Penetration Testing Professional Certificate
- Prepare for the CompTIA PenTest+ (PT0-001) Exam
- Getting Started with Linux
- Prepare for the Linux Foundation Certified System Administrator (LFCS) Exam