Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

Linux Fundamentals - Part 5: Bash Scripting (Hello World & Variables)

What Is Bash? Bash stands for Bourne Again SHell. It is the default shell on most Linux systems. It allows you to: Run commands interactively Write scripts…

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




What Is Bash?



Bash stands for Bourne Again SHell.

It is the default shell on most Linux systems.

It allows you to:




  • Run commands interactively

  • Write scripts (files containing commands)
    A bash script is simply a text file with Linux commands executed line by line.





First Bash Script



Step 1: Create a file.

vim kervie.sh

This opens vim in Normal mode.



Step 2: Go to insert mode by pressing i.



Step 3: Add this content




#!/bin/bash
echo "Hello, World!"






Step 4: Save and exit

Press Esc then type :wq. to save the file.





Understanding the Script





#!/bin/bash





It is called the shebang.

It tells Linux to use Bash to execute the script.




echo "Hello World!"






Prints text to the terminal.






Making the Script Executable



By default, scripts are not executable. Fix that with:

chmod +x kervie.sh





Running the Script



Run the script like this:

Type ./kervie.sh

Output:




Hello World!









Introducing Variables in Bash



A variable allows you to store data and reuse it throughout your script.

Basic variable syntax:

variable_name=value

Important rules:

No spaces around '='.

Variable names are case-sensitive.





Script with Variables



Let’s create another script.

Step 1: Open a new file with Vim.




vim kvariable.sh






Press i to enter Insert mode.



Step 2: Write the script




#!/bin/bash

name="Kervie Jay Sazon"
echo "Hello, $name!"






Step 3: Save and exit

Press ESC, then:

:wq



Step 4: Make it executable and run it




chmod +x kvariable.sh

./kvariable.sh






Output:




Hello, Kervie Jay Sazon!






How Variables Work?




name="Kervie Jay Sazon"






Stores text in a variable called name.




$name






Retrieves the value stored in name.



Variables make scripts dynamic, reusable, and easier to maintain.



Note:

1 Do not add spaces around =.




name="Kervie jay"






2 Don't forget $ when using variables.

3 Don't forget to make the script executable.

Example:




chmod +x kvariable.sh






4 Running without ./.

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

Bedrohungsgraph · ATT&CK-Mapping · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
4 Knoten · 3 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
MITRE ATT&CK Matrix Navigator
Enterprise-Matrix · nur belegte Techniken
14 Taktiken
1 belegte Technik
T1059TA0002 · Execution
Command and Scripting Interpreter
Mitigation: M1038 Execution Prevention & Script Block Logging
Quelle: Kontext-Klassifikation des Artikeltextes
Reconnaissance
Resource Development
Initial Access
Execution
Persistence
Privilege Escalation
Defense Evasion
Credential Access
Discovery
Lateral Movement
Collection
Command and Control
Exfiltration
Impact
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Linux Fundamentals - Part 5: Bash Scripting (Hello World & Variables)

Thematisch verwandte Begriffe: Linux, Fundamentals, Part, Bash · 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
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag