Bash Introduction
Bash is a shell that takes typed commands and runs them on the computer. A shell is a program that passes commands to the system and shows the results.
One command, one line of output
The echo command prints the words inside the quotes. The printed line matches the quoted words exactly.
echo "Bash runs commands"Commands run in order
Two echo commands print two lines. The first command finishes before the second one starts.
echo "First line"
echo "Second line"A short list of steps
Three echo commands print a small checklist. Each line appears in the same order as the commands.
echo "Step one: open the folder"
echo "Step two: check the files"
echo "Step three: start the backup"Example
echo "Morning check"
echo "Disk space looks fine"
echo "Backup folder is ready"
echo "All checks done"Key points
- Shell: a program that takes commands and runs them.
- Bash: a widely used shell found on most Linux and macOS systems.
- Command: one instruction that tells the computer to do one job.
- Script: a text file that holds a list of commands.
- echo: a command that prints text to the screen.
- Automation: letting a script repeat a job without typing each step.
In this example, four echo commands run from top to bottom. The first command prints the title line. The next two commands print one check result each. The last command prints the closing line.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does the echo command do?