← Back to Bash Course | Chapter 1: Setup & Basics | Lesson 1 of 12

What is Bash?

Bash is like a chat window where you type instructions to your computer and it does them right away. You can also save a list of instructions in a file so the computer follows them all in order.

In this page:

  1. What is Bash?

What is Bash?

Bash (Bourne Again SHell) is a command-line interpreter and scripting language that serves as the default shell on most Linux distributions and, until recently, on macOS.

It lets you run commands interactively and automate repetitive tasks by writing scripts. Bash is central to DevOps, system administration, automation pipelines, and server management -- essentially every Linux server you'll ever work with relies on it.

Note: Even if you never write a large Bash script, comfort with Bash is essential -- nearly every deployment pipeline, Docker container, and CI/CD system relies on shell commands under the hood.

Example: What is Bash?

bash
#!/bin/bash
echo "Hello, World!"
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
Common Mistakes
  1. Assuming Bash and sh are the same, when scripts using Bash-only features like [[ ]] or arrays can fail under a plain POSIX sh.
  2. Confusing Bash (the shell program) with the terminal window, which is only the application that displays a shell.
  3. Thinking Bash is only for typing commands, when it is also a full scripting language with variables, loops and functions.

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.