Bash turns Linux commands you'd type by hand into repeatable automation — the gateway to DevOps and the cloud. This applies your Linux Fundamentals knowledge as programming.
Bash Scripting
Turning Linux commands into automation.
Tap or hover a part to learn more.
#!/bin/bash
The first line #!/bin/bash tells the system which interpreter to run the script with. Make the file executable with chmod +x, then run ./script.sh.
Check your understanding
1. What does the shebang do?
2. How do you read the first argument passed to a script?
Keep learning
The building blocks
- Shebang —
#!/bin/bashstarts a script;chmod +xmakes it executable. - Variables & arguments —
NAME="jane",$1for the first argument. - Conditionals & loops —
if,for,whileto make decisions and repeat work. - Composition — combine commands, pipes and exit codes into robust scripts.
Bash shares the same core concepts as Python and PowerShell. For the Linux-specific detail, see Linux Fundamentals: Bash; here the focus is the programming mindset that transfers to any language.
