0 of 16 lessons done
Course classroom
CompTIA Linux+ XK0-006

Day 13 of 15

Day 13 · Bash scripting and Git

Turn the manual backup into a script that makes its own decisions, and keep every version of your scripts in Git.

⏱ 2 hours 🧪 16 terminal tasks ✅ 10 review questions 🔒 Part of the full course

By the end of this day you will be able to

  • Write scripts with a shebang, execute permission, comments and exit statuses.
  • Use variables, arguments ($1, $#, $@), $? and expansions such as ${VAR:-default}.
  • Make decisions with if, test, [ ] and [[ ]], and with case.
  • Repeat tasks with for, while and until, and read files line by line.
  • Organize code into functions and compute with $(( )) and $( ).
  • Version scripts with Git: config, init, add, commit, log, diff, branches, merge, remotes and .gitignore.

Topics

  • Shebang and chmod +x
  • Variables and quoting
  • $1, $#, $@ and $?
  • Exit statuses
  • if, test and [[ ]]
  • case
  • for, while and until
  • Functions
  • $( ), $(( )) and ${VAR:-default}
  • Git: commits, branches, merge and remotes

This lesson is part of the full course

It includes the full explanation, 16 terminal tasks that check themselves and 10 review questions. If you already bought the course, sign in and pick up where you left off.

Full course: $99 (regular price $149) · one payment · 12 months of access

Already paid? Sign in with the email you used to buy: we send you a 6-digit code, no password.

Want to try it first? Take a free trial of the course. Questions? Message us on WhatsApp.

Loading your lesson…

Go to the course classroom

See all the lessons in the course

The companies, people and data in the course stories are fictional; any resemblance to reality is coincidental.