Interactive roadmap
Shell and Bash roadmap
For beginners who want to control their computer using text commands and automate everyday tasks with simple scripts.
- 1
Using the Terminal
0 of 4 done
Learn how to open the shell and type your very first commands.
Take it steady and do not worry about memorising every command straight away; practice makes it stick. - 2
Pipes and Text Tools
0 of 4 done
Connect commands together and search through text effortlessly.
Think of pipes as small funnel channels linking different tools together to build custom workflows. - 3
Variables and Conditions
0 of 3 done
Store information and make decisions in your command lines.
Naming your variables clearly makes your scripts much easier to read weeks later. - 4
Loops and Functions
0 of 3 done
Repeat tasks automatically and group your commands neatly.
Test your loop logic with a small list of items before running it on hundreds of important files. - 5
Writing Bash Scripts
0 of 3 done
Combine everything into proper script files and write clean code.
Always test your scripts in a safe sandbox folder away from important personal files.
Learn it all, with a tutor that never sleeps
Every topic links to LevelUp lessons, practice exercises and the 24/7 AI Tutor. Your progress updates as you master lessons.
Every topic explained
Step 1: Using the Terminal
- Find and open the command line interface on your operating system so you can start typing.
Read more
The terminal is a text-based interface that lets you talk directly to your computer operating system. Instead of clicking folders with a mouse, you type text commands to get things done.
Imagine running a shop and typing stock updates into a ledger rather than moving boxes by hand. It feels direct and fast once you get used to the blinking cursor.
Learning to open your terminal is the first step to unlocking powerful computer control.
- Terminals accept typed text commands
- Blinking cursor shows where to type
- Replaces mouse clicks with keyboard input
- Use simple commands to look inside folders and change your current location on the computer.
Read more
Moving around folders in the terminal means changing your working directory using simple text commands. You use short codes to see what files are in front of you and step inside folders.
Think of walking through an office building and stepping into different filing cabinets to find the paperwork you need.
Knowing where you are in your file system stops you from losing important documents and lets you work efficiently.
- Use pwd to check your current folder
- Use ls to list files inside folders
- Use cd followed by a folder name to move
- Learn how to make new files and folders, plus how to move or delete them safely.
Read more
File actions let you create brand new text files, make fresh folders, and safely move or tidy up your digital items without using a mouse.
Imagine tidying your physical desk by dropping loose receipts into labelled cardboard boxes and throwing away old scrap paper.
This skill matters because automation relies on creating and shifting files around your computer automatically.
- Use touch to create empty files
- Use mkdir to make new folders
- Use mv and rm to move and delete items
- (optional)
- Save time by using arrow keys for history and tab key for auto-completion.
Read more
Keyboard shortcuts are secret productivity boosts that stop you from retyping long file names or remembering tricky past commands.
Imagine having a button on your keyboard that instantly finishes spelling long customer names while you type.
Using these shortcuts saves you endless keystrokes and keeps your fingers comfortably on the home row.
- Press the tab key to auto-complete file names
- Use up and down arrows to cycle past commands
- Press ctrl and c to stop a stuck command
Step 2: Pipes and Text Tools
- Send the results of your commands straight into a text file using special arrows.
Read more
Command redirection lets you catch the output that usually flashes on your screen and save it directly into a plain text file.
Imagine a cash register printing a paper receipt of your daily sales total and dropping it straight into a filing tray.
This is essential when you want to save logs or reports generated by your computer for later reading.
- Use a greater than symbol to save output
- Creates new files or overwrites existing ones
- Captures results instead of showing them on screen
- Send the output of one command directly into another command to build powerful workflows.
Read more
Pipes let you take the output from one command and feed it straight into the input of another command without saving intermediate files.
Think of a factory conveyor belt where raw metal parts pass through a cutter and then straight into a painter.
Building pipelines helps you combine simple tools to solve complex text processing problems in seconds.
- Represented by the vertical bar symbol
- Passes data from left to right
- Combines multiple small tools into workflows
- Use a handy search tool to quickly find specific words or phrases inside large documents.
Read more
Text searching tools let you scan through thousands of lines of text in a split second to hunt down specific words or phrases.
Imagine flipping through a massive telephone directory with a high-speed highlighter to find one specific surname.
Finding specific text quickly is vital when you are debugging scripts or searching through large system log files.
- Uses the grep command for searching
- Finds exact words or patterns in files
- Can filter output coming through a pipe
- (optional)
- Quickly check how many lines, words, or characters are inside your files.
Read more
Counting tools quickly tally up how many lines, words, or individual characters exist inside your text files.
Imagine weighing a sack of mail at the post office to instantly know roughly how many letters are inside.
This helps you quickly check the size of data sets or confirm that logs are being generated properly.
- Uses the wc command for counting
- Can count lines, words, and characters
- Works great at the end of a pipe
Step 3: Variables and Conditions
- Save text and numbers into named boxes so you can reuse them later in your work.
Read more
Variables are named storage boxes that hold pieces of text or numbers so you can use and change them throughout your script.
Imagine a labelled jar on your shelf where you drop a slip of paper with a customer name written on it.
Variables let you write flexible scripts that adapt to different values every time you run them.
- Assign values using an equals sign
- Access stored values using a dollar sign
- Keep names clear and descriptive
- Tell your script to do one thing if a condition is true, and something else if it is not.
Read more
If statements give your scripts the ability to check conditions and make simple choices based on what they find.
Think of a thermostat checking the room temperature and turning on the heater only if it drops below twenty degrees.
Adding logic makes your scripts smart enough to handle different situations without crashing.
- Checks if a condition is true or false
- Runs specific code blocks based on results
- Uses fi to mark the end of the check
- (optional)
- Make your commands interactive by pausing to let the person typing give an answer.
Read more
Reading user input pauses your script so the person sitting at the keyboard can type an answer or choice.
Imagine an automated ticket machine asking you to press a button to choose your ticket destination.
This turns rigid scripts into interactive programs that can talk to users and respond to their specific needs.
- Uses the read command to capture typing
- Stores typed answers inside variables
- Makes scripts interactive and flexible
Step 4: Loops and Functions
- Run the exact same command over a list of many different files without typing it out repeatedly.
Read more
For loops let you repeat the exact same set of commands over a list of multiple items without rewriting code.
Think of a delivery driver walking down a street and dropping a package on the porch of every house on the list.
Loops are the core secret to automating boring, repetitive computer chores in seconds.
- Loops through a list of items one by one
- Repeated actions go inside the loop body
- Saves writing repetitive commands manually
- (optional)
- Keep a task running continuously until a specific stopping condition is finally met.
Read more
While loops keep running a task over and over again for as long as a specific condition remains true.
Imagine pumping water into a bucket until a float valve signals that the bucket is finally full.
This is useful when you need to wait for a background process to finish or check a system status repeatedly.
- Continues running while condition holds true
- Needs a way to eventually stop looping
- Prevents infinite loops with proper checks
- Bundle a set of commands together under a single new name so you can run them easily anytime.
Read more
Custom functions let you bundle a group of commands together under one new name so you can call them whenever needed.
Think of a chef saving a favourite recipe card so they can whip up that meal instantly without listing ingredients each time.
Functions keep your scripts organised, tidy, and free of duplicated code.
- Group commands under a custom name
- Call the function anytime in your script
- Improves script organisation and readability
Step 5: Writing Bash Scripts
- Put your commands inside a plain text file and make it executable so it runs like a program.
Read more
Making your first script file turns a collection of plain text commands into a standalone program you can run whenever you like.
Imagine writing a shopping list recipe on paper, giving it a special run permission, and handing it to a robot assistant.
This is where you graduate from typing one-off terminal lines to building real automation tools.
- Start files with a proper bash header
- Grant execute permissions using chmod
- Run your script using a dot slash prefix
- Add simple safety checks to your scripts so they stop immediately if something goes wrong.
Read more
Handling errors safely means adding checks so your script halts immediately if something unexpected happens.
Imagine a car engine automatically shutting off if oil pressure drops, preventing total engine destruction.
Good error handling stops tiny script mistakes from accidentally deleting or messing up your files.
- Add safety flags at the script start
- Stop execution when commands fail
- Protect your system from accidental damage
- (optional)
- Write notes to yourself inside your script code using hash symbols so you remember how it works.
Read more
Commenting code involves leaving plain English notes inside your script using hash symbols to explain what your code does.
Imagine leaving post-it notes on a kitchen appliance explaining how to adjust the timer settings for visitors.
Clear comments help your future self understand why you wrote the script a certain way months down the line.
- Comments start with a hash symbol
- Ignored by the computer when running
- Explains the reasoning behind your code