
Explore the course structure and core topics of bash and shell scripting essentials, laying the foundation for practical command-line skills.
Learn how Linux Bash and shell scripts automate tasks, understand the difference between shell scripts and Bash scripts, and explore advantages like automation, portability, and easy debugging through practical examples.
Explore how to declare and use variables in bash scripts, including environment variables, user defined variables, readonly mode, and accessing values with dollar signs, plus reading input and creating files.
Explore how to use comparison operators in shell scripting to test variables, strings, and conditions, and learn how equal, not equal, greater than, and less than guide decision making.
Explore conditional statements using if and else, not equal to operator, and case structures to execute code blocks based on conditions, with nested conditions and user input.
Explore bash loop statements: while, for, and until; control flow with break and continue, iterate with arrays and echo, and build infinite or user-driven loops.
Learn how positional arguments pass values to a shell script, access them with $1 and $2, and understand shell parameters, variables, and predefined special parameters.
Store command outputs in variables, verify the working directory with pwd, and use ls -la to inspect directory contents, then apply if-else logic to confirm the correct directory.
Explore exit codes of shell commands, where 0 means success and non-zero signals failure, and learn to view, set, and use them in scripts with $?.
Discover how redirection changes input and output destinations, including overwrite and append redirection, to save command output and feed file data.
Explore merged and error redirection in Bash scripts, redirecting stdout and stderr to files like test.txt and error.txt, and discarding output with /dev/null while noting shell compatibility.
Explore here documents in shell scripting by passing multi-line strings to commands with a delimiter token and ending input on its own line using cat, wc, or sort.
Learn how piping transfers a command's output with the pipe character, enabling chained commands, redirection to files, and text processing by filters.
Learn how to create and use functions in shell scripts, return values, pass different arguments, and build abstractions like a backup function that copies a directory to a destination.
Learn to pass and parse Linux shell script arguments with positional and named options, using getopts and shift to iterate and validate parameters.
Explore file operations in shell scripts, including reading, writing, appending, moving, renaming, deleting, and changing permissions. Learn to check file existence and size and to read lines with a loop.
Learn how to use the grep command to search for patterns and filter text in scripts. Explore options like case-insensitive search, line numbers, counting matches, word matching, and recursive searches.
Master creating aliases in shell scripts to shortcut common commands, enable alias expansion at the start, and boost readability and maintainability with descriptive names, comments, and testing.
Learn how signals notify a shell process of events like sigint or termination and use the trap command for graceful shutdowns.
Master debugging in shell scripts by using set -x to trace commands and variables, and by employing echo statements, descriptive names, modular functions, and thorough input testing.
Explore regex, a powerful tool for text manipulation and pattern matching, and learn shell features to search, replace, and extract patterns with dot, dollar, and asterisk examples.
Explore the sed command as a stream editor that searches, replaces, inserts, and deletes text in shell scripts, with practical examples of substitutions, deletions, and insertions.
Create a bash shell script that uses switch cases and echo to handle user input, displaying login counts, last logins, and the current user's group information.
Delete zero sized files with a bash script that checks directory existence, iterates files using a for loop, and removes zero byte files with rm.
Explore process management in shell scripting by creating background processes, using pids, and leveraging ps and top to monitor CPU usage and terminate loops.
Learn to interpret a command's exit status with grep, using zero for success and non-zero for failure, then guide an if-else flow via pipe results from a random command.
An Operating System consists of many components, but its two main components are: Kernel and Shell.
What is Kernel?
Kernel; It enables communication between hardware and software. Kernel is the innermost part of an operating system. It is responsible for managing all of the system's resources, such as the CPU, memory, and storage. The kernel also provides a set of system calls that allow user-mode programs to interact with the hardware.
What is Shell?
Shell is a program that lets you interact with your computer's operating system. It takes the commands you type in and turns them into instructions that the operating system can understand.
What is Shell Script?
Shell Script is an open-source computer program designed to be run by the Unix/Linux shell program. Shell scripts allow us to write down a sequence of shell commands in a file and then execute them all at once. This can save us a lot of time and effort, especially if we need to run the same commands regularly.
With this course, we will see the basics of writing shell scripts in this command sequence. Now let's take a look at the contents of Shell Scripting Essentials:
Variables
Comparison Operators
Conditional Statements
Loops
Positional Arguments
Storing Output of Command
Exit Codes of Commands
Redirection
Here Document
Piping
Functions
Parse Script Arguments and Parameters
File Operations
Grep Command
Aliases
Wait Command
Signal Handling
Debugging
Regex
Sed Command
Examples