An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
Bash
terminal automation deployment and file workflows
Definition first
What Bash means
Bash is a programming language for writing exact instructions, often used for terminal automation deployment and file workflows. Start with one mental model: input goes through steps and becomes output.
script.shRun bash script.shHabit Echo variables and use set flags before touching many filesA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
POSIX shell compatible terminal is the place that actually runs code from script.sh.
First readable code
Commands
pwd ls cd echoname="Ada" echo "$name"
Output AdaLanguage lineage
Bash family tree
See where Bash comes from, which languages feel close, and what to learn next.
terminal automation, deployment scripts, and file workflows
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Bash practice 1
Bash question 1. Choose the statement that matches echo output.
Bash practice 2
Bash question 2. Choose the statement that matches variable assignment.
Bash practice 3
Bash question 3. Choose the statement that matches pipe.
Bash practice 4
Bash question 4. Choose the statement that matches for loop.
Bash practice 5
Bash question 5. Choose the statement that matches echo output.
Bash practice 6
Bash question 6. Choose the statement that matches variable assignment.
Bash practice 7
Bash question 7. Choose the statement that matches pipe.
Bash practice 8
Bash question 8. Choose the statement that matches for loop.
Bash practice 9
Bash question 9. Choose the statement that matches echo output.
Bash practice 10
Bash question 10. Choose the statement that matches variable assignment.
Bash practice 11
Bash question 11. Choose the statement that matches pipe.
Bash practice 12
Bash question 12. Choose the statement that matches for loop.
Bash practice 13
Bash question 13. Choose the statement that matches echo output.
Bash practice 14
Bash question 14. Choose the statement that matches variable assignment.
Bash practice 15
Bash question 15. Choose the statement that matches pipe.
Bash practice 16
Bash question 16. Choose the statement that matches for loop.
Bash practice 17
Bash question 17. Choose the statement that matches echo output.
Bash practice 18
Bash question 18. Choose the statement that matches variable assignment.
Multiple choice
Bash practice 1
Bash question 1. Choose the statement that matches echo output.
echo "$name"
Reference
Patterns for script.sh
bash script.shpwd ls cd echo
Commands
name="Ada" echo "$name"
- Quote variables
- Start with echo
- Run in a small folder first
grep sort uniq wc
Pipes
printf "a\na\nb\n" | sort | uniq
- Pipe output to the next command
- Use rg or grep for search
- Count with wc
shebang variables if loops
Scripts
for file in *.txt; do echo "$file" done
- Use set -e for safer scripts
- Quote paths
- Dry run before deleting