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,805 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

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
  • 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
  • Some common commands part 213:36
  • 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
  • Vi Editor Part 117:16
  • 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
  • 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
  • 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
  • find part 410:59
  • 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
  • grep part 49:47
  • 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
  • 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
  • test condition and statement in shell script18:14
  • 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
  • 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
  • Here Documents and multi line comments11:48
  • Trap and Signals Part 111:07
  • 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
  • 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
  • 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
  • Partition, formatting and mounting a partition.9:16
  • 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.