Brace expansion is a mechanism by which arbitrary strings may be generated. It occurs before any other expansions and is handled by the shell itself, not the specific command (like wget or cat).

  • The Example: archive.{001..016}
  • Expansion: archive.001 archive.002 ... archive.016
wget download_url.archive{00..16}

So we can use:

cat archive.7z.{001..004} > combined.7z

instead of

cat archive.7z.001 archive.7z.002 archive.7z.003 archive.7z.004 > combined.7z

Note: don’t use \ before { sign. It will ignore expansion and treat it as a regular character.

I used this to shorten my commands. This is very helpful.

bash terminal Terminal CheatSheet My Custom Bash Scripts