bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/Bash/Bash Tutorial
Bash•Bash Tutorial

Bash Tutorial

Learn Bash

Bash is used to write scripts and run commands on Linux systems.

It helps automate tasks, manage system operations, and boost productivity.

Understanding Shells

A shell is a text-based interface that lets you talk to your computer.

There are different types of shells, but Bash (Bourne Again SHell) is the most popular because it's powerful and easy to use.

Types of Shells

  • Bourne Shell (sh): The original Unix shell, developed by Stephen Bourne.
  • C Shell (csh): Known for its C-like syntax, popular for interactive use.
  • Korn Shell (ksh): Combines features of sh and csh, offering advanced scripting capabilities.
  • Bash (Bourne Again SHell): An improved version of sh, with additional features like command history and tab completion.

Why Use Bash?

  • It is widely available on Unix/Linux systems, making scripts portable.
  • Supports powerful scripting features, including loops, conditionals, and functions.
  • Provides command history and tab completion for ease of use.
  • Can be integrated with other Unix/Linux tools for automation.

In this tutorial, we will show you Bash commands like this:

Example

bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

For new users, using the terminal view can seem a bit complicated.

Don't worry! We will keep it really simple, and learning this way gives you a good grasp of how Bash works.

In the code above, you can see commands (input) and output.

Lines like this are commands we input:

Example

bash --version

Lines like this are the output/response to our commands:

Example

GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

In general, lines with $ in front of it is input. These are the commands you can copy and run in your terminal.

Chapter

Back to Bash Tutorial

Next

Bash Introduction

This chapter

Overview
3

Lessons

6m

Read time

1. Bash Tutorial2. Bash Introduction3. Getting Started with Bash

On this page

Learn BashUnderstanding Shells