Skip to content
Learn Netverks

Lesson

Step 2/36 6% through track

what-is-bash

What is Bash?

Last reviewed Jun 1, 2026 Content v20260601
Track mode
none
Means
Read / quiz
Reading
~2 min
Level
beginner

This lesson

This lesson teaches What is Bash?: the syntax, patterns, and safety habits you need before advancing in Bash.

Teams still ship What is Bash? in Bash codebases—skipping it leaves gaps in debugging and code reviews.

You will apply What is Bash? in contexts like: CI jobs, server maintenance, local dev automation, and Git hooks.

Read each lesson, copy bash examples into your own terminal, and complete the lesson MCQs—there is no in-browser runner for security reasons.

Alongside Git and Tools—after you can navigate a terminal; Python helps for heavier logic than shell alone.

Bash is an interactive command interpreter and a scripting language. It reads a line of text, splits it into a program name and arguments, starts that program, and shows you stdout and stderr.

Core characteristics

  • POSIX heritage — builds on the Bourne shell (sh) with extensions
  • Text in, text out — values are strings unless you use arithmetic expansion
  • Composition — small tools connected with pipes and redirection
  • Ubiquitous — default on many Linux distros; macOS often uses zsh as login shell but Bash remains common in scripts

Interactive vs script

# Interactive: type at the prompt
$ echo "Hello from Bash"
Hello from Bash

# Script: save to hello.sh, make executable, run
echo "Hello from Bash"

Interactive mode is great for exploration. Scripts make tasks repeatable—essential for CI and server maintenance.

Where Bash appears

CI pipelines, Docker entrypoints, server maintenance, Makefiles, and local dev scripts. Pair with Git for hooks and Tools for terminal setup.

Important interview questions and answers

  1. Q: Is Bash only for Linux?
    A: No—macOS, WSL on Windows, and containers all use Bash or Bash-compatible shells.
  2. Q: Bash vs Python for automation?
    A: Bash excels at calling existing CLI tools and file operations; Python excels at complex logic and libraries—teams use both.

Self-check

  1. What extension do Bash scripts often use?
  2. Name one production place Bash runs besides your laptop.

Tip: Run bash --version locally; macOS may ship an older Bash while scripts in CI use newer GNU Bash.

Interview prep

Interactive vs script?

Interactive runs line by line; scripts batch commands for repeatability and CI.

What does a shebang do?

Tells the OS which interpreter executes the file when run as a program.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Bash vs zsh login?
  • Script shebang?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump