Lab 1 of 8 · The shell, files and text tools
Set up your lab server and explore it
Create an Ubuntu server on your computer, connect it to GitHub, and use the shell to answer questions about the system.
- Time
- 60 minutes
- Cost
- Free. The server runs on your own computer.
What you learn
System administrators live in the shell. You create a free Linux server on your own computer, learn where things live, and combine small text tools to answer real questions about a system.
- Running a Linux server on your own computer with Multipass
- Where configuration, logs, programs and home folders live
- Pipes and text tools: cut, sort, uniq, wc, find and head
- Keeping your work in Git, straight from the server
In the AI era: AI assistants explain commands instantly. A sysadmin still checks the manual and tests on a lab machine first, because one wrong flag on a real server can delete data.
Get set up
Commands use Homebrew in the Terminal app. Already have a tool? Skip it.
- A terminalOfficial install page ↗
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Use the Terminal app. The command installs Homebrew, which the other macOS commands use.
- A free GitHub accountOfficial sign-up ↗
- Multipass (a free Ubuntu server on your computer)Official install page ↗
brew install --cask multipassCheck it worked:
multipass version
Before you start
Your computer needs about 10 GB of free disk space and 4 GB of memory.
Step by step
1 Create your lab server
This downloads Ubuntu 24.04 and starts it as a small virtual server called
sysadmin-lab. Everything you break in this roadmap breaks there, not on your computer.multipass launch 24.04 --name sysadmin-lab --cpus 2 --memory 2G --disk 10G multipass listYou should see:sysadmin-labisRunningwith an IPv4 address.2 Open a shell on it
From now on, steps labelled "Run this on your lab server" run in this shell. Type
exitto leave it.multipass shell sysadmin-labYou should see:Your prompt changes to
ubuntu@sysadmin-lab:~$.3 Look around
/etcholds configuration,/var/logholds logs,/homeholds users' files and/usr/binholds programs.whoami hostname grep PRETTY_NAME /etc/os-release ls / ls /var/log | headYou should see:ubuntu,sysadmin-lab,Ubuntu 24.04inPRETTY_NAME, then the top-level folders and some log files.4 Answer questions with pipes
Each tool does one small job, and the pipe
|passes its output to the next. These lines answer: how many accounts exist, which login shells they use, and which are the five biggest files under/var/log.wc -l /etc/passwd cut -d: -f7 /etc/passwd | sort | uniq -c | sort -rn sudo find /var/log -type f -printf '%s %p\n' | sort -rn | head -n 5You should see:A number of accounts, a count per login shell (most are
/usr/sbin/nologin: service accounts that cannot sign in), and five file sizes in bytes with their paths.5 Ask AI to explain a command, then check it
Ask your AI assistant to explain the last command above, flag by flag. Then check one claim yourself in the built-in help. If the AI and the help disagree, the help wins.
find --help | grep -i printfYou should see:A line listing
-printf FORMATamongfind's actions.6 Connect GitHub and create your repository
Use your own name and GitHub email.
gh auth loginshows a one-time code and a web address: open the address in the browser on your computer and enter the code. Choose HTTPS when asked.git config --global user.name "Your Name" git config --global user.email "you@example.com" sudo apt-get update sudo apt-get install -y gh gh auth login --hostname github.com --git-protocol https --web gh auth setup-git gh repo create linux-admin-lab --public --add-readme --clone cd linux-admin-labYou should see:Logged in as YOUR-USERNAME, then a newlinux-admin-labfolder that you are now inside.7 Write your first notes
Create it with
mkdir -p notesandnano notes/01-shell.md(save with Ctrl+O, exit with Ctrl+X), and answer in your own words.# The shell on my lab server ## Where things live - `/etc`: ... - `/var/log`: ... - `/home`: ... ## What I found - Number of accounts: ... - Most common login shell and why: ... - Biggest log file: ... ## A command I can now explain - `cut -d: -f7 /etc/passwd | sort | uniq -c | sort -rn`: ...8 Commit and push
Save your work to GitHub from the server.
git add notes git commit -m "Add shell exploration notes" git pushYou should see:The commit appears in your repository on github.com.
9 Stop the server when you are done
Type
exitto leave the server, then stop it from your own computer. It keeps everything until you start it again.multipass stop sysadmin-lab
You are done when
multipass listshowssysadmin-lab.You can say what lives in
/etc,/var/logand/home.notes/01-shell.mdis on GitHub, pushed from the server.
We check your public GitHub repository and give you a page to share with recruiters, and can add the project to your resume.