
Learn how the pwd command prints the current working directory in bash, with practical examples from home, music, and ben directories to show absolute paths.
Master the cd command to navigate directories using absolute and relative paths, the home shortcut (~), and cd - and cd .. to move back or up.
Learn to use grep to search files for patterns, pipe results with commands, and apply options such as -o, -c, -v, -A and -B with regular expressions and colored output.
Learn what a script is: a sequence of commands stored in a file, with loops and arguments, and how to create, set permissions, and run it in the terminal.
Learn to craft robust shell scripts by understanding the shebang, choosing /bin/bash interpreters, setting executable permissions, and ensuring cross-machine compatibility.
Explore Bash string comparison with single and double brackets, quoting, and space sensitivity, learning how to test for equal or not equal and identify root user status.
Interested what [ -f $FILENAME ], [ -d $PATH ] and other filesystem comparisons can do?
for loop theory
From real world: for what purpose we use for loop
loop through all script arguments using for arg in "$@" to handle each argument separately, and contrast with "$*" that joins all arguments.
Build a bash script that mimics cat with line numbers, accepting one file argument, printing each line with a number, and reporting if the file doesn't exist.
Explore using getopts to parse positional parameters A and B with required arguments and C and D without arguments, demonstrating case statements and automatic dash handling in bash scripts.
Learn how awk reports the number of fields per line using NF, indices like $F, and arithmetic to display or compute field counts in space-delimited input.
Use the print command to display lines that match a pattern, suppress default printing with -n, and apply ranges and the last line reference for precise file output.
Learn how to use sed to append or prepend text to specific lines, match lines by a pattern, insert before lines, and add text at the first line.
Explore sed's substitute command, using s/old/new/ to replace text, apply line ranges (1,$), perform in-place edits with -i, and reuse the matched text with &.
Explore a sed-based script that reads files line by line, detects leading or trailing spaces and tabs, and prints clean lines while exiting on issues.
Learn how to tidy sed scripts by fixing trailing space issues, control newline output with echo, and add conditional messages with a green background to indicate fixes.
Welcome to linux bash shell scripting course. I'am Richard and I will be your instructor. I have great knowleadge about shell scripting as throughout my carrer I had been working for Fortune 50 company, where I apart from taking care of 200+ Solaris servers wrote many scripts for keeping live easy :)
What is covered?
Basics of scripting - no worry you don't know anything about scripting by now
Sha-bang explanation - what it is and why the heck it is called sha-bang
Decision making
Regular expressions
Wildcards
For & While loops
Functions
Reading arguments using CASE structure
Getopt
Getopts
...and many more
And what about AWK? Yes, it is covered here! And what about SED? Also covered!
Why I have created this course?
Many years back, when I was starting as UNIX administrator, I had many ideas how to improve specific things using scripts. But, I couldn't find any good resource, which would take me through all needed topic in one place. Somewhere I got great explanation about sha-bang while regular expressions for shell scripting were only mentioned. Somewhere was good explanation about decision making in if statement, but SED and AWK part was missing, and that use of SED and AWK was in my carrer really important. Basically I cannot imagine any single production script, where I wouldn't used SED or AWK, because without them you are not able to create that "magic" in your script.
Many years later, I am here to share in one place what is really needed in order to create magic script. Not only how to create script, do some decision making in if statements, write functions, use arrays, but mainly how to combine everything including AWK and SED. I was creating this course in a way, which would help me a lot to create great scripts during start of my career. All needed things in one place.
Please, watch my preview lectures to see what we are going to build in this course.