An Overview of Shell Expansion in Bash

Expansion is a useful technique for expanding certain types of characters or symbols in Bash. These characters, symbols or syntax are not just literal and have different meanings to Bash shell. These allow users to create a large number of tokens just by writing a few letters. In this article, I will discuss different types of shell expansion in Bash and their implementation.

Types of Shell Expansion in Bash

There are different types of shell expansion. The main types of expansions are:

  1. Brace Expansion
  2. Tilde Expansion
  3. Parameter Expansion
  4. Command Substitution
  5. Arithmetic Expansion
  6. Word Spiting
  7. Filename Expansion or Glob Expansion
  8. Process Substitution.

All these expansions combined are known as shell expansion. I will discuss each of these briefly.

Before that, you can run man bash and search for the text ^EXPANSION to see the manual page.