Skip to content

Both.org

News, Opinion, Tutorials, and Community for Linux Users and SysAdmins

Primary Menu
  • About Us
  • Computers 101
    • Hardware 101
    • Operating Systems 101
  • End of 10 Events
    • Wake Forest, NC, — 2025-09-20
  • Linux
    • Why I use Linux
    • The real reason we use Linux
  • My Linux Books
    • systemd for Linux SysAdmins
    • Using and Administering Linux – Zero to SysAdmin: 2nd Edition
    • The Linux Philosophy for SysAdmins
    • Linux for Small Business Owners
    • Errata
      • Errata for The Linux Philosophy for SysAdmins
      • Errata for Using and Administering Linux — 1st Edition
      • Errata for Using and Administering Linux — 2nd Edition
  • Open Source Resources
    • What is Open Source?
    • What is Linux?
    • What is Open Source Software?
    • The Open Source Way
  • Write for us
    • Submission and Style guide
    • Advertising statement
  • Downloads
  • Home
  • Programming Bash #1 – Introducing a New Series
  • Bash
  • Linux
  • Programming

Programming Bash #1 – Introducing a New Series

David Both December 22, 2023 4 minutes read
Gnu-bash-logo.svg

Last Updated on June 3, 2024 by David Both

I use Bash all the time, in part because it is the default shell for most Linux distributions, including Fedora and CentOS, the ones I normally use. However I also use Bash because it is an excellent shell and it has a large number of features to make life easier for the Lazy SysAdmin.

Features like tab completion, command line recall and editing, shortcuts like aliases, and more all contribute to its value as a powerful shell. One of my favorite Bash features is that, although it uses Emacs mode for command line editing by default, that can be changed to Vi mode so that I can use editing commands that are already part of my muscle memory.

But if we think of Bash solely as a shell we miss much of its true power. While researching Bash for my three-volume Linux self-study course1, upon which this series of articles is based, I learned things about Bash that I never knew in over 20 years of working with Linux. Some of these new bits of knowledge relate to its use as a programming language. Bash is a powerful programming language, one perfectly designed for use on the command line and in shell scripts. For this series we are exploring its use on the command line interface (CLI).

Let’s start with a few basics.

What is a shell?

A shell is the command interpreter for for the operating system. Each of the many shells available for Linux interprets the commands typed by the user or SysAdmin into a form usable by the operating system. When the results are returned to the shell program, it displays them on the terminal. All of the shells with which I am familiar are also programming languages.

Bash stands for Bourne Again Shell because the Bash shell is based upon the older Bourne shell which was written by Steven Bourne in 1977. Many other shells are available.2 The four I list here are the ones I encounter most frequently but many others exist.

  • csh – the C shell for programmers who like the syntax of the C language.
  • ksh – the Korn shell, written by David Korn and popular with Unix users.
  • tcsh – a version of csh with more ease of use features.
  • zsh – which combines many features of other popular shells.

All shells have some built-in commands that supplement or replace the commands provided by the core utilities. Open the man page for Bash and find the “BUILT-INS” section to see the list of commands provided by the shell itself.

I have used the C shell, the Korn shell and the Z shell. I still like the Bash shell more than any of the others I have tried. Each shell has its own personality and syntax. Some will work better for you and others not so well. Use the one that works best for you, but that might require that you at least try some of the others. You can change shells quite easily.

All of these shells are programming languages as well as a command interpreter.

About this Series

There are seven additional articles in this series. Each of the first four articles introduces you to an aspect of Bash such as its use on the command line, using loops and logical operations. The final four articles will introduce you to programming with Bash, both from the command line as well as the use of Bash programs which are also known as scripts.


Series Articles

This list contains links to all eight articles in this series about Bash.

  1. Programming Bash #1 – Introducing a New Series
  2. Programming Bash #2: Getting Started
  3. Programming Bash #3: Logical Operators
  4. Programming Bash #4: Using Loops
  5. Programming Bash #5: Automation with Scripts
  6. Programming Bash #6: Creating a template
  7. Programming Bash #7: Bash Program Needs Help
  8. Programming Bash #8: Initialization and sanity testing

Resources

  1. Both, David, Using and Administering Linux – Zero to SysAdmin: 2nd Edition, Apress, 2023 ↩︎
Tags: Bash Programming

Post navigation

Previous: Drop swap for zram on Linux
Next: Make swap better with zram on Linux

Related Stories

Typewriter-lead
  • Books
  • Linux
  • Printing
  • Using and Administering Linux

Book Update — Chapter 26, Printers

David Both May 1, 2026
connections_wires_sysadmin_cable
  • Linux
  • Networking
  • Router

How to Make your Linux Box Into a Router

David Both April 29, 2026
f44-01-day-cropped
  • Fedora
  • Linux
  • Upgrades

Fedora 44 Released

David Both April 28, 2026

System upgrades this Sunday, May 3

Tools illustrationFedora 44 was released this week and I’ve upgraded all my systems except for the two that directly affect Both.org. I’ll be upgrading the hosts for my server and firewall to Fedora 44 this Sunday afternoon, May 3.

Both.org will be down for most of the afternoon for these upgrades.

Thanks for your patience.

Random Quote

Premature optimization is the root of all evil.

— Donald Knuth

Why I’ve Never Used Windows

On February 12 I gave a presentation at the Triangle Linux Users Group (TriLUG) about why I use Linux and why I’ve never used Windows.

Here’s the link to the video: https://www.youtube.com/live/uCK_haOXPFM 

Why there’s no such thing as AI

Last October at All Things Open (ATO) I was interviewed by Jason Hibbits of We Love Open Source. It’s posted in the article “Why today’s AI isn’t intelligent (yet)“.

Technically We Write — Our Partner Site

Our partner site, Technically We Write, has published a number of articles from several contributors to Both.org. Check them out.

Technically We Write is a community of technical writers, technical editors, copyeditors, web content writers, and all other roles in technical communication.

Subscribe to Both.org

To comment on articles, you must have an account.

Send your desired user ID, first and last name, and an email address for login (this must be the same email address used to register) to subscribe@both.org with “Subscribe” as the subject line.

You’ll receive a confirmation of your subscription with your initial password as soon as we are able to process it.

Administration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

License and AI Statements

Both.org aims to publish everything under a Creative Commons Attribution ShareAlike license. Some items may be published under a different license. You are responsible to verify permissions before reusing content from this website.

The opinions expressed are those of the individual authors, not Both.org.

You may not use this content to train AI.

 

Advertising Statement

Both.org does not sell advertising on this website.


Advertising may keep most websites running—but at Both.org, we’re committed to keeping our corner of the web ad-free. Both.org does not sell advertising on the website. Nor do we offer sponsored articles at this time. We’ll update this page if our position on sponsorships changes.

We want to be open about how the website is funded. Both.org is supported entirely by David Both and a few other dedicated individuals.

 

 

Copyright © All rights reserved. | MoreNews by AF themes.