1. Home
  2. Library
  3. IT & Software
Curated Library

Bash Scripting on Linux: From First Script to Automated Backups

An 18-part walkthrough of Bash scripting on Linux, starting with writing and running a first script and moving through variables, conditionals, loops, functions, arguments, redirection, scheduling and a backup script. Two short extras cover customizing the prompt and overriding cd. It suits Linux beginners and aspiring sysadmins who already have a terminal available.

20 lessons 5h 31m total IT & Software English Earns YodaCoins
Lessons by Learn Linux TV on YouTube

Curated by YodaHut. These lessons are hosted on YouTube and produced by their original creators, who are not affiliated with YodaHut. You still earn YodaCoins, keep your streak and track progress here.

What You'll Learn

  • Write a Bash script, mark it executable with chmod, and run it
  • Use variables, command output and environment variables, and do basic integer math in scripts
  • Control script flow with if/else, file and command existence checks, exit codes, case statements, and while and for loops
  • Separate standard output and standard error, and handle each in a script
  • Organize scripts with functions and command-line arguments, and check that required arguments were supplied
  • Store scripts in /usr/local/bin and add directories to PATH so they run from anywhere
  • Schedule scripts with at and cron, and read a complete backup script with a dry-run option
  • Customize the Bash prompt (PS1) and define shell functions such as an auto-ls cd

Prerequisites

  • Access to a Linux system or VM (the examples use apt, so Debian/Ubuntu is easiest)
  • Basic comfort with the terminal, such as navigating directories and running commands
  • A text editor available in the terminal

About the Instructor

Learn Linux TV

YouTube creator

20 lessons here 5h 31m

The lessons in this course were produced by Learn Linux TV and are published on YouTube. YodaHut selected and sequenced them into this course; we did not make them, and Learn Linux TV is not affiliated with YodaHut.

Visit the channel on YouTube
  • 20 lessons
  • 5h 31m of video
  • Earns YodaCoins & streaks
  • Timestamped notes
  • Free — hosted on YouTube

No certificate is issued for Library courses.