Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Practical Bash Scripting On Linux and Mac OSX
Rating: 4.5 out of 5(298 ratings)
14,822 students

Practical Bash Scripting On Linux and Mac OSX

Learn Shell scripting by example on Posix compliant system on Linux, MacOS X or any Posix system
Created byShakil khan
Last updated 3/2026
English
English [Auto],

What you'll learn

  • Build small scripts and automate things in Linux. Students should be able to use linux commands to efficient work.

Course content

1 section56 lectures9h 46m total length
  • Course contents5:42

    Master bash scripting on Linux and macOS by learning shell fundamentals, commands, redirections, pipes, process management, signals, and basic networking concepts.

  • Introduction.10:17

    Learn how shell scripts run as interpreted programs, explore bash basics, and master variables, functions, and debugging techniques such as set -x and syntax checks.

  • uname, hostname, diskutil, fdisk, terminal, Mac oterm216:09
  • File System and Directory Hierarchy7:19

    Explore the Linux and Unix file system hierarchy from the root to key directories such as /bin, /usr, /home, /lib, and /proc, and learn mounting concepts.

  • Multi tasking and Multi User5:06

    Explore multitasking and multi-user concepts in Linux, showing how the kernel scheduler switches between processes to run concurrently, while isolating each user's context and using synchronization like locks and semaphores.

  • Shell and env variables13:42

    Learn how environment variables, such as PATH and library paths, guide binary discovery on Linux and Mac, and master exporting, unsetting, and persisting them across shells and child processes.

  • Common Commands18:43

    Explore common Linux and Mac commands to list files, use long and hidden file views, and navigate directories with ls options, permissions, and path concepts like root and working directory.

  • Some common commands part 213:36

    Learn common Linux commands like cat and ls, create and view files with redirection and piping, and safely delete recursively with rm -rf.

  • cp, mv, clear, inode11:57

    discover how cp copies files and blocks and how mv moves or renames items. understand inode as a reference to data blocks and how clear resets the terminal.

  • who, whoami, tty, which, locate10:09

    Use who to see which users are logged in. Learn how whoami shows your current user, and how which and locate clarify command paths and file searches.

  • Calendar, date, time14:16

    Learn to use cal for calendars and the date command for time, formatting, and time zones such as UTC and London, including setting system dates.

  • Vi Editor Part 117:16

    Learn the basics of Vim, install Vim, switch between insert and command modes, edit text with delete, yank, and paste, search and replace, and navigate by lines and marks.

  • Vi editor part 27:30

    Master vi editor basics: open files, edit, save, quit with standard or forced commands; split windows, cycle between panes, and move with h j k l, undo edits.

  • chmod user permission12:02

    Learn how chmod controls user, group, and other permissions using read, write, and execute bits. Explore numeric permissions (4,2,1) and the risks of setting 777.

  • chown, chmod, getent, chgrp8:19

    Learn to change file ownership and group with chown and chgrp, apply permissions recursively with chmod, and verify users and groups using getent.

  • Background and foreground jobs and no hangup8:03

    Manage background and foreground jobs in bash using no hangup, bring a job to the foreground by its number, kill it, and redirect output to a file.

  • Sort and Uniq command6:42
  • Top and ps command6:55

    Learn to use the top command and the ps command to view system uptime, load, memory, and per-process details, and use batch mode for scripting.

  • Pipes and redirection Part 113:46

    Describe how Linux and Unix use file descriptors for standard input, output, and error, and how redirection with >, >>, and dev/null directs and handles command output.

  • Pipes and redirection Part 211:49

    Master bash pipes and redirection, including exec usage, redirecting file descriptors, and tee to display and log output, with examples involving less, wc, and find.

  • wild cards9:52

    Explore wild cards in bash, using question marks and asterisks to match single or multiple characters, brackets and ranges for patterns, with backslash escaping to treat literals.

  • Find Part 18:04

    Explore the find command to locate files and folders starting from the current directory, using -name and case-insensitive searches, wildcards, depth limits, and exclusions.

  • find Part 211:00

    Explore practical examples of the find command: search by name, extension, and type, use case-insensitive matching, limit depth, and locate hidden files in Linux and Mac OSX.

  • find part 39:27

    Explore advanced file searches with the find command, filtering by name, extension, permissions (including sticky bit and 777), owner, and using superuser privileges carefully.

  • find part 410:59

    Learn to use the find command on Linux to locate files by modified, accessed times and by size, search by name patterns, and safely pipe results to xargs for execution.

  • grep Part 16:52

    Learn to use grep for cross-file searches, compare basic and extended regular expressions, and apply options such as -F, -n, and -r for fixed strings, line numbers, and recursive search.

  • grep Part 212:10

    Master grep to search across files and folders with case-insensitive patterns and wildcards. Learn to invert matches, display filenames, and pipe results to awk for symbol extraction.

  • grep part 310:49

    Learn to search files with grep using patterns and regex, use word boundaries for exact matches, hide filenames with -H, perform case-insensitive searches -i, and show line numbers -n.

  • grep part 49:47

    Learn how to use grep to search for keywords across files with patterns, fixed strings (-F), and pattern files (-f), show matches with context (-A/-B) and pipe input.

  • Various Components of Shell Script10:17

    Explore the components of a shell script, learn how it runs as an interpreted language, and master debugging with bash, comments, variables, functions, arguments, and exit status.

  • Functions and command line argument processing13:04
  • While Loop8:50

    Explore how while loops control bash scripts by evaluating conditions, using sleep to pace execution, and incrementing counters. Learn infinite loops with while true and one-liner usage.

  • Until Loop4:20

    Learn how the bash until loop runs while the condition is false and exits when it becomes true, with examples using false conditions and a countdown.

  • For loop and various syntax of for8:27

    Explore the bash for loop and its variants, from simple lists to numeric ranges and c-like syntax, including infinite loops and sequence iterations.

  • if condition11:10

    Explore bash scripting with if statements, conditional expressions, and else if constructs, learn how true conditions execute statements, and use numeric and string comparisons in shell code.

  • test condition and statement in shell script18:14

    Learn to use bash test conditions to check file existence and type—block devices, character devices, regular files, and directories—and apply POSIX compliant test expressions.

  • read user input4:59

    Learn to capture user input in bash with the read command, which blocks until enter and stores data in a variable or array, using -n and -a options.

  • Case statement AKA Switch4:22

    Explore the case statement in bash, a switch-like construct that evaluates a variable against patterns, uses default handling, and requires double semicolons to exit each case inside a while loop.

  • File Handling and Processing12:52

    Learn to open a file and read it line by line in bash with while read, parsing lines, counting them, and performing basic operations while avoiding subshell variable loss.

  • Exit Status of a shell10:12

    Explore how the shell reports exit status, distinguish zero (success) from non-zero errors, and use the $? variable, exit codes, and handling of cases like no such file or directory.

  • Random Number and its use case5:11

    Explore generating and using random numbers in bash scripts, including ranges like 1 to 1000, looping for multiple samples, and applying randomness to timing and file naming.

  • Arrays and iterating over different ways19:09

    Explore bash arrays: declare and index elements, create lists with spaces, access by index, iterate with for loops and read input, and manipulate strings and numbers in practical scripting.

  • Here Documents and multi line comments11:48

    Learn to use here documents for multi-line comments and automating bash scripts with a start token at the line start and an end token, noting security.

  • Trap and Signals Part 111:07

    Explores trap and signal in Linux as interprocess communication; explains signals, kill, trap, and SIGINT, and how to handle or trap signals in programs.

  • Trap and signals Part 213:22

    Learn trap and signal handling in bash, using functions for cleanup and signal actions, and control termination with kill, SIGINT, and exit to avoid zombie processes.

  • Trap and signals part 36:01

    Explore trap and signal handling in bash, including capturing signals, using continue in loops, and managing sleep and kill events across bash and sh differences.

  • Trap and signals part 48:51

    Explore how signal handlers manage exit signals, traps, and interruptions in a bash script, with examples of sleep, log cleanup, and cleanup behavior.

  • Trap and signals part 59:41

    Learn how to use bash traps to restore and replace signal handlers for ctrl-c on linux and mac os x, including one-time and time-based exits with cleanup.

  • Date and time14:16

    Learn to use cal to view calendars, date to format day, month, and year across time zones like UTC and London, and time to measure script runtime.

  • dd and od command and how to copy file using dd11:56

    Master dd and od to copy files, create sparse files, or fill disks with /dev/zero, and inspect data in hex or ascii, using block size and count to control size.

  • df, du, lsof, netstat19:42

    Explore disk usage and open file management on Linux and Mac using df, du, lsof, and netstat; read outputs in human readable format and troubleshoot open file descriptors.

  • dmidecode, lscpu, lspci, SMBIOS, DMI7:02

    Explore how Linux commands dmidecode, lscpu, and lspci reveal BIOS, processor, and hardware details via SMBIOS and DMI, with examples on virtual machines and real hardware.

  • Partition, formatting and mounting a partition.9:16

    Attach a new disk in a virtual or physical environment, partition the drive, create a partition table, format in Linux or macOS environments, and mount the partition for use.

  • nmap for network and port scanning8:16

    Learn to use nmap for network and port scanning on Linux and Mac OS X, covering installation, basic commands, timing options, and firewall considerations.

  • ssh, scp and sshpass9:40

    Learn to use ssh for terminal access from mac os x to linux machine, specify port 22, username, and IP, scp with sshpass for file transfer, and enable x11 forwarding.

  • tcpdump and pcap6:23

    Learn to use tcpdump to capture and inspect network traffic across Linux, macOS, and Windows. Filter by interface and port, save pcap files, and interpret protocol data for diagnostics.

Requirements

  • PC with any Linux distribution like Ubuntu, fedora, centos, kali etc

Description

Learn shell scripting by example across various platforms, including Linux, Mac OS X, and different Linux distributions such as Fedora, Red Hat, SUSE, CentOS, and more.

Examine each isolated script in detail — break it down into its individual parts, understand the inner workings, and learn how to efficiently combine them into fully functional scripts.

Create scripts from a set of Linux commands and integrate them with useful, real-world applications.

Follow easy-to-understand examples that maintain practicality while keeping each concept clearly isolated for focused learning.

Automate repetitive and mundane tasks with shell scripts.

Build expertise in essential Linux command-line tools such as grep, find, awk, date, chmod, chown, trap, and many more.

Understand system internals and the Linux boot process from the ground up.

Explore detailed, practical examples of how to perform file operations using shell scripts.

Master file redirection — learn how to redirect console output to a file and work with various file descriptors.

Gain a thorough understanding of background and foreground processes, including how to switch between them seamlessly.

Learn how to inspect process details and monitor memory consumption using the top and ps commands.

Understand how to trap and send signals to a shell script — a critical skill for preventing abnormal termination caused by Ctrl+C or other unexpected signals.

Get an overview of inodes and learn how to create symbolic links.

Learn about the case statement in Linux with clear, practical examples.

Master iteration in Linux using for loops, while loops, and discover different approaches to achieve the same results.

Follow detailed explanations with examples on how to read user input and process it effectively.

Learn how to work with arrays efficiently — including how to declare, populate, and represent them.

Who this course is for:

  • Students willing to make their career in Linux environment. Also for professionals who wanted to delve in Linux as career.