Zum Hauptinhalt springen
Windows Tipps & SecurityAmazon Prime wird günstiger – aber nicht für alle Kunden(03.10.2026 um 09:00 Uhr)
•••
Windows Tipps & SecurityGoogle schließt weitere kritische Sicherheitslücke in Chrome(03.10.2026 um 09:11 Uhr)
••••••
Sicherheitslücken (CVE)CVE-2026-12541 | Foreman command injection (WID-SEC-2026-3712)(03.10.2026 um 08:32 Uhr)
•
Windows Tipps & SecurityAmazon Prime wird günstiger – aber nicht für alle Kunden(03.10.2026 um 09:00 Uhr)
•••
Windows Tipps & SecurityGoogle schließt weitere kritische Sicherheitslücke in Chrome(03.10.2026 um 09:11 Uhr)
••••••
Sicherheitslücken (CVE)CVE-2026-12541 | Foreman command injection (WID-SEC-2026-3712)(03.10.2026 um 08:32 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

The Concept of Expansion in the Linux Command Line

In this short article, we will be exploring an important concept in linux shell called expansion. When you type a command and press the Enter key, bash…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Linux Command Line

In this short article, we will be exploring an important concept in linux shell called expansion.



When you type a command and press the Enter key, bash performs several processes upon the argument text before it executes the command. This process is called “expansion”.



Let’s see the different types of expansion within the shell.



1) Pathname expansion: The shell first expands the path (current directory) to get all the files that end with .js (see image below) after which the ls command is performed on the result.



pathname expansion



2) Tilde expansion: From the example below, the shell expands the tilde (~) sign to get the home directory of the user before executing the echo command on its result.



tilde expansion



3) Arithmetic expansion: From the screenshot below, the shell performs the computation (expansion) before the echo command is executed on its result.



arithmetic expansion



4) Brace expansion: This is the most fascinating expansion. It simplifies complex tasks with just a single command. After expansion, dir-{1..5} becomes dir-1 dir-2 dir-3 dir-4 dir-5, before the mkdir is performed on them, creating 5 directories.



brace expansion



5) Parameter expansion: This is more useful in shell scripts than directly on the command line. It is also known as variables. From the image below, the shell expands $USER to get its value and passes it to the echo command. Use the printenv command to see all variables.



parameter expansion



6) Command substitution: This allows you to use the output of a regular shell command as an expansion. See example below



command substitution expansion



Lastly for this session, we will discuss a concept called “quoting” used to control expansion performed in shell. It is used to suppress unwanted expansions. There are 2 types of quoting, double and single quotes.



Double quotes: This will suppress any kind of special characters usually meant for expansion and treat them as ordinary characters except for $ (dollar), \ (backslash), and ` (back tick) signs.



double quoting



Single quotes: With this, you can suppress all expansions.



single quoting



I hope you learnt about a few of the superpowers that the Linux Shell embodies.



Thanks for your time. Your feedback will be much appreciated.

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten The Concept of Expansion in the Linux Command Line

Thematisch verwandte Begriffe: Concept, Expansion, Linux, Command · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag