Have you tried to learn shell scripting on your own, but lack the structure you need to really improve your skills?
Are you tired of picking up bits and pieces of information that you can't just seem to put together?
Do you learn best by doing?
If so, you're going to love this course.
One of the biggest complaints I hear from students is that most of the courses they've taken in the past simply provide information without any context and without any idea of how to put that information to use.
This course turns that old, frustrating, and outdated way of learning on its head.
Have you tried to learn shell scripting on your own, but lack the structure you need to really improve your skills?
Are you tired of picking up bits and pieces of information that you can't just seem to put together?
Do you learn best by doing?
If so, you're going to love this course.
One of the biggest complaints I hear from students is that most of the courses they've taken in the past simply provide information without any context and without any idea of how to put that information to use.
This course turns that old, frustrating, and outdated way of learning on its head.
It's project-based, which means instead of learning bits and pieces of information, you'll write actual shell scripts that you can use in real-world situations. You get the chance to immediately put what you learn to use so that you fully understand and remember it.
In this Linux shell scripting course you will learn how to:
When you enroll, you get lifetime access to the course. Your course never expires. You can study at your own pace and refer back to the lessons whenever you want.
I stand behind my courses and care about your goals. That's why this course comes with an unconditional 30-day money-back guarantee. It's my personal promise of your success. So...
If you're ready to level-up your shell scripting skills, enroll now.
Welcome to this Linux Shell Scripting course!
Download the shell scripting class files that include solutions to the exercises.
How to create a local lab environment using Vagrant and VirtualBox.
Instructions for creating a local lab environment using Vagrant and VirtualBox.
Note: Only use this lesson if you are using Windows as your operating system. If you are not, proceed to the next lesson.
Learn how to install Vagrant and VirtualBox on Windows.
Note: Only use this lesson if you are using Mac with an Intel processor as your operating system. If you are not, proceed to the next lesson.
Learn how to install Vagrant and VirtualBox on Mac.
Note: Only use this lesson if you are using CentOS or Red Hat Enterprise Linux as your operating system. If you not, proceed to the next lesson.
Learn how to install Vagrant and VirtualBox on CentOS/RHEL.
Note: Only use this lesson if you are using Mac with an Apple Silicon processor as your operating system. If you are not, proceed to the next lesson.
This lecture is only for those who are using computers with an Apple Silicon chip, such as the M1, M2, or later. If you are using a slightly older Mac computer using an Intel chip, skip this lesson. If you are not using Mac, you should also skip this lesson.
Note: This lesson is for everyone, no matter what operating system you are using. (Windows, Mac, CentOS, RHEL)
If you encountered errors with Vagrant or Virtualbox, use the strategies in this lesson to fix those issues.
Shell scripting concepts covered in this lesson:
Pseudocode and pseudocoding.
Special variables created by the shell including UID.
How to store the output of a command in a variable with command substitution.
The if statement.
The id command.
The whoami command.
How to read help and man pages.
Command options, order, and conventions.
Conditionals, operators, and expressions.
The [[, [, and, test shell builtins.
The command separator.
Exit statuses.
Piping output to the less pager.
Executing commands as root with the sudo command.
Using the su command to switch users.
Sanity and “idiot” checking.
Concepts covered in this lesson:
Exit status conventions.
Controlling the exit status of your shell script with the exit shell builtin.
Shell Special Variables.
Checking the return code or exit status of a command by examining the contents of the $? special variable.
String test conditionals.
DRY – Don’t Repeat Yourself.
Shell scripting concepts covered in this lesson:
Getting input from the person executing the script using the read shell builtin.
Introduction to standard input, standard output, and standard error.
Creating accounts with the useradd command.
Username conventions including length, case, and valid characters.
Using the “-” or “-l” options to the su command to simulate a full login when switching users.
Controlling the default account creation behaviors by editing the /etc/login.defs file.
Using quotes to make a string that contains spaces behave as a single argument or item.
Setting passwords with the passwd command interactively and programmatically.
Using pipes to chain together multiple commands.
Expiring accounts with the passwd command
The goal of this exercise is to create a shell script that adds users to the same Linux system as the script is executed on.
Shell scripting concepts covered in this lesson:
Generating random data.
How to automate the creation of a random password.
The RANDOM shell builtin variable.
Event designators (shell shortcuts).
Display the current date and time using the date command in various formats.
Unix time, POSIX time, and epoch time.
Checksums and cryptographic hash functions.
The sha1sum and sha256sum commands.
Verifying downloads with checksums.
The head, fold, and shuf commands.
How to work through pipes. (Data munging, text manipulation, string manipulation.)
Shell Scripting concepts covered in this lesson:
Positional parameters. ($0, $1, $2, $3, etc.)
The difference between arguments and parameters.
The which command.
The command search path and the PATH shell variable.
The hash shell builtin.
The basename and dirname commands.
Using command substitution within another command without assigning it to a variable first.
The for loop.
Special parameters including $#, $@, and $*.
Shell scripting concepts covered in this lesson:
The while loop.
The true shell builtin.
The sleep command.
Creating and breaking out of infinite loops.
Send an interrupt signal by typing Ctrl-C.
The shift shell builtin.
Concepts covered in this lesson:
Concepts covered in this lesson:
Learn how to use the "case" statement in your shell scripts.
Shell scripting concepts covered in this lesson:
Reasons to create functions
DRY vs WET programming concepts:
DRY: Don’t Repeat Yourself
WET: Write Everything Twice, We Enjoy Typing, Waste Everyone’s Time
Defining functions
Calling functions
Sending messages to the syslog subsystem with the logger command.
Where to place functions in your script.
Variable scope and the local shell builtin.
Passing in data to a function.
Making variables read-only with the readonly shell builtin.
How to backup files before you change them.
Exit status of functions and the return command.
Shell scripting concepts covered in this lesson:
How to accept and parse command line options.
Why getopts is better than using an if or case statement.
Performing mathematical calculations in your scripts.
Using the basic calculator: bc.
Learn how to use "getops" in your shell scripts.
Shell scripting concepts covered in this lesson:
Deleting users with the userdel command.
Expiring and locking accounts with the chage command.
How to find commands not in your PATH.
Using the locate and find commands.
Matching patterns with the grep command.
Using the !! and !$ event designators to speed up your workflow at the command line.
UID for system accounts and normal user accounts.
Creating and restoring backups and archives with the tar command.
How to compress files with gzip and uncompress them with gunzip.
Why not to lock accounts with the passwd command or by using the nologin shell.
Demonstration of the userdel and id commands.
Demonstration of the tar, gzip, and gunzip commands.
Demonstration of using the chage, passwd, and usermod commands.
In this lesson, you will learn how to use the "cut" and "awk" commands.
Demonstration of using the cut and awk commands.
In this lesson, you will learn how to use the sort and uniq commands.
In this shell scripting exercise, you'll be parsing data using the awk, cut, sort, and uniq commands.
The goal of this exercise is to create a shell script that displays the number of failed login attempts by IP address and location.
In this lesson, you will learn how to use sed.
In this lesson you will learn how to create a small network of VMs that will simulate a company network. You'll also learn how to configure ssh key authentication and execute commands on remote systems over ssh.
The goal of this exercise is to create a shell script that executes a given command on multiple servers.
This lesson is reminder of just some shell scripting concepts and techniques you've learned during this course.
In this lesson, you will learn:
What shell scripts are.
Why you should learn bash shell scripting.
How shell scripts can be helpful to you.
Shell scripting examples and use cases.
The contents of this lecture are so secret I'm not even allowed to describe it! Open, if you dare.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.