Linux+ exam prep: automation and scripting
You write Bash and Python scripts, version them with Git, automate configuration with Ansible and build container images safely.
Level 201 · 15 lessons · 12 practice labs
Lessons
Bash scripts
- Script structure: variables, conditions, loops and functions
- Building reports with text-processing pipelines
- Error handling, exit codes and writing logs
- Running automatically with cron and systemd timers
- Short task: write and schedule a disk-usage alert script
Python, regular expressions and Git
- Short Python scripts for admin work
- Extracting log lines with regular expressions
- Versioning scripts with Git: branches, merges, tags
- Short task: release your script in a Git repo with a branch and a tag
Configuration management and containers
- Your first automation with Ansible
- Infrastructure as code: repeatability and drift
- Running containers: images, networks, volumes
- Writing your own image and keeping it secure
- Continuous integration: testing scripts on every change
- Capstone: automate user onboarding end to end
Practice labs
- Produce a bulk account report from a user list: You write a script that loops over usernames in a text file and prints whether each account exists, its shell and its home directory.
- Produce a top-ten table from an access log: With a chain of awk, sort and uniq you report the ten busiest addresses and the five paths with the most errors in one script.
- Write a clean-up script that does no harm on bad input: You add input checks, exit codes, logging and a dry-run option to a script that deletes old archives and show it deletes nothing on bad input.
- Extract valid IP addresses from a log: With a regular expression you pull the IPv4 addresses out of a messy log into a sorted list without duplicates.
- Convert a log to CSV with Python: You write a short Python script that parses an authentication log line by line into a CSV with date, user, source and result columns.
- Write an account audit script in Python: You write a script that reads copies of the account files and reports accounts with non-expiring passwords, open shells and UID 0 as JSON without crashing on bad lines.
- Turn a scripts folder into a Git repository: You start a repository in a messy scripts folder, ignore the junk files and build the history with two meaningful commits.
- Merge two branches that changed the same line: You resolve the conflict from merging two branches that changed the same configuration line and verify the script still runs.
- Revert a broken release and publish a new tag: You revert a faulty commit without rewriting history, add the fix and create a new annotated release tag.
- Gather facts from two nodes with one command: You write a small inventory and collect the kernel version and free disk space from two managed nodes with one-line commands.
- Run a web container with persistent data: With rootless podman you bind a web container to a host port and a persistent volume and show the data remains after it is recreated.
- Write an image that runs as an unprivileged user: For a small script service you build and run an image with a pinned base, an unprivileged user and no needless packages.
About this course
You write Bash and Python scripts, version them with Git, automate configuration with Ansible and build container images safely.
What you will learn
- Bash scripts
- Python, regular expressions and Git
- Configuration management and containers
Prerequisites
Finishing the level 101 courses of the same path, or knowing those topics, is enough.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at level 201; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.