Linux Shell Scripting: A Project-Based Approach to Learning
Write Your Own Linux Shell Scripts. Deploy Cryptographic Hash Functions. Process Command Line Arguments. Start Shell Scripting in Linux Now!
- Self-paced with Life Time Access
- Certificate on Completion
- Access on Android and iOS App
Linux Shell Scripting: A Project-Based Approach to Learning
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:
- Name your shell scripts.
- Use the proper permissions on your shell scripts.
- Create and use variables in your scripts.
- Use shell built-in commands and operating system commands.
- Make the most out of special variables that are available to you in your scripts.
- Make decisions by using if statements and performing several different kinds of tests
- Check the exit statuses of commands and why you need to.
- Use cryptographic hash functions
- Create random data so you can do things like automatically generate strong passwords for user accounts.
- Perform the same action or set of actions over a series of data utilizing for loops, while loops, and infinite loops.
- Control all types of input and output.
- Accept standard input from a user as well as from another program.
- Redirect standard output and standard error.
- Combine standard output and standard error
- Use command pipelining
- Perform text and string manipulation.
- Process command line arguments
- Creating functions and when to do so.
- Parsing, analyzing, and reporting on log files, CSV files, and other data.
- Writing scripts that execute commands on other systems.
- Much, much, more...
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.
If you're ready to level-up your shell scripting skills, enroll now!
Who this course is for:
- Linux system administrators, developers, programmers, or anyone who wants to learn Linux shell scripting
- A basic understanding of the Linux command line
- The ability to download large files of about 500 MB from the Internet
- Access to a computer with a 64-bit processor running either Windows, Mac, or Linux. (You do not need Linux already installed to take this course.)
- Write your very own Linux shell scripts using the concepts you learned in this course
Note: This lesson is for everyone, no matter what operating system you are using. (Windows, Mac, CentOS, RHEL)
Note: Only use this lesson if you using CentOS or Red Hat Enterprise Linux as your operating system. If you not, proceed to the next lesson.
Concepts covered in this lesson:
- Naming shell scripts and file extensions.
- Shell script file permissions and the chmod command.
- Shebangs
- Comments
- Variables
- Quoting – single vs double quotes.
- Shell Builtins including echo, type, and help.
- Displaying information to the screen with the echo shell builtin.
- Getting help on shell builtins by using the help builtin.
- Getting help on Linux commands by using the man command.
- The touch command.
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 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
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
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.)
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 $*.
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:
- A deeper look at standard input, standard output, and standard error.
- File descriptors.
- Redirecting standard output to a file.
- Redirecting standard error to a file.
- Redirecting standard output and error to a file.
- Redirecting standard input from a file.
- Redirecting standard output and error through a pipe.
- Redirecting standard error to standard output.
- Redirecting standard output to standard error.
- Overwriting and appending output to a file.
- The null device.
Concepts covered in this lesson:
- A deeper look at standard input, standard output, and standard error.
- File descriptors.
- Redirecting standard output to a file.
- Redirecting standard error to a file.
- Redirecting standard output and error to a file.
- Redirecting standard input from a file.
- Redirecting standard output and error through a pipe.
- Redirecting standard error to standard output.
- Redirecting standard output to standard error.
- Overwriting and appending output to a file.
- The null device.
Concepts covered in this lesson:
- Reasons to create functions
- 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.
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.
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.