# Linux Bash Scripting

> Writing automation scripts, file directory operations, and loop controls in Linux Bash shell.

- Skill: `lord1egypt/linux-bash-scripting-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lord1egypt/linux-bash-scripting-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lord1egypt/linux-bash-scripting-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT license
- Author: Lord1Egypt (https://skillmd.com/u/lord1egypt)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/lord1egypt/linux-bash-scripting-2

---


# Linux Bash Scripting

## Overview
Bash is a Unix shell and command language that automates command sequences.

## When to Use This Skill
Use to automate local directory backups, deployment cycles, dependency setups, and batch actions.

## Quick Start (with runnable code examples)

```python
#!/bin/bash
# Loop through all files in a folder and list names
for file in /home/lordegypt/TelegramBOTS/*; do
    if [ -d "$file" ]; then
        echo "Bot Folder: $(basename "$file")"
    fi
done
```

## Advanced Usage
Manage process exits, write trap commands for code cleanups, parse script flags (`getopts`), and perform stream manipulations (`sed`/`awk`).

## Key References
- [Bash Guide for Beginners](https://tldp.org/LDP/Bash-Beginners-Guide/html/)

## Dependencies
- Bash Shell

