Skip to content

Commit 3cba9f5

Browse files
committed
added readme
1 parent 540244e commit 3cba9f5

1 file changed

Lines changed: 263 additions & 0 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
<div align="center">
2+
3+
```
4+
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
5+
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•
6+
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•—
7+
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘
8+
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
9+
β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•
10+
```
11+
12+
### *automate everything. break nothing.*
13+
14+
<br/>
15+
16+
![Shell](https://img.shields.io/badge/Shell-Bash-4EAA25?style=for-the-badge&logo=gnu-bash&logoColor=white)
17+
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
18+
![License](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)
19+
![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen?style=for-the-badge)
20+
![Maintained](https://img.shields.io/badge/Maintained-Yes-success?style=for-the-badge)
21+
22+
<br/>
23+
24+
> 🐚 A curated collection of **Linux Bash scripts** β€” from beginner fundamentals to real-world automation tools.
25+
> Built for learners, sysadmins, and developers who love the terminal.
26+
27+
</div>
28+
29+
---
30+
31+
## πŸ“– Table of Contents
32+
33+
- [✨ About](#-about)
34+
- [πŸ—‚οΈ Repository Structure](#️-repository-structure)
35+
- [πŸš€ Getting Started](#-getting-started)
36+
- [πŸ“œ Script Categories](#-script-categories)
37+
- [πŸ› οΈ Usage](#️-usage)
38+
- [πŸ’‘ Tips & Best Practices](#-tips--best-practices)
39+
- [🀝 Contributing](#-contributing)
40+
- [πŸ“„ License](#-license)
41+
42+
---
43+
44+
## ✨ About
45+
46+
This repository is a **hands-on learning ground** for Linux Bash Scripting.
47+
48+
Whether you're just starting out with shell scripts or looking to sharpen your automation game, you'll find practical, well-commented scripts covering a wide range of topics β€” from basic syntax and control flow to file manipulation, process management, and beyond.
49+
50+
```bash
51+
$ echo "Why learn Bash?"
52+
> Because the terminal is where the real power lives.
53+
```
54+
55+
---
56+
57+
## πŸ—‚οΈ Repository Structure
58+
59+
```
60+
Linux-Bash-Scripting/
61+
β”‚
62+
β”œβ”€β”€ πŸ“ basics/ # Variables, input/output, comments
63+
β”œβ”€β”€ πŸ“ control-flow/ # if/else, loops, case statements
64+
β”œβ”€β”€ πŸ“ functions/ # Reusable functions and libraries
65+
β”œβ”€β”€ πŸ“ file-operations/ # Read, write, parse, manipulate files
66+
β”œβ”€β”€ πŸ“ system-admin/ # Disk, memory, process monitoring
67+
β”œβ”€β”€ πŸ“ networking/ # Ping checks, port scanners, curl scripts
68+
β”œβ”€β”€ πŸ“ automation/ # Cron jobs, backups, schedulers
69+
β”œβ”€β”€ πŸ“ text-processing/ # awk, sed, grep, cut, sort
70+
└── πŸ“ projects/ # End-to-end real-world mini-projects
71+
```
72+
73+
---
74+
75+
## πŸš€ Getting Started
76+
77+
### Prerequisites
78+
79+
Make sure you have the following:
80+
81+
- A **Linux / macOS** system (or WSL on Windows)
82+
- `bash` version **4.0+**
83+
84+
```bash
85+
bash --version
86+
```
87+
88+
### Clone the Repository
89+
90+
```bash
91+
git clone https://github.com/Kishan-Miskin/Linux-Bash-Scripting.git
92+
cd Linux-Bash-Scripting
93+
```
94+
95+
### Run Your First Script
96+
97+
```bash
98+
chmod +x basics/hello_world.sh
99+
./basics/hello_world.sh
100+
```
101+
102+
---
103+
104+
## πŸ“œ Script Categories
105+
106+
<table>
107+
<thead>
108+
<tr>
109+
<th>Category</th>
110+
<th>Description</th>
111+
<th>Difficulty</th>
112+
</tr>
113+
</thead>
114+
<tbody>
115+
<tr>
116+
<td>🟒 <strong>Basics</strong></td>
117+
<td>Variables, data types, user input, echo/printf</td>
118+
<td>Beginner</td>
119+
</tr>
120+
<tr>
121+
<td>🟒 <strong>Control Flow</strong></td>
122+
<td>if/elif/else, for, while, until, case</td>
123+
<td>Beginner</td>
124+
</tr>
125+
<tr>
126+
<td>🟑 <strong>Functions</strong></td>
127+
<td>Declaring, calling, scoping, return values</td>
128+
<td>Intermediate</td>
129+
</tr>
130+
<tr>
131+
<td>🟑 <strong>File Operations</strong></td>
132+
<td>Reading files, writing logs, parsing CSVs</td>
133+
<td>Intermediate</td>
134+
</tr>
135+
<tr>
136+
<td>🟑 <strong>Text Processing</strong></td>
137+
<td>awk, sed, grep, tr, cut, sort, uniq</td>
138+
<td>Intermediate</td>
139+
</tr>
140+
<tr>
141+
<td>πŸ”΄ <strong>System Admin</strong></td>
142+
<td>CPU/RAM monitoring, disk usage, process management</td>
143+
<td>Advanced</td>
144+
</tr>
145+
<tr>
146+
<td>πŸ”΄ <strong>Networking</strong></td>
147+
<td>Ping sweeps, port scanning, curl API calls</td>
148+
<td>Advanced</td>
149+
</tr>
150+
<tr>
151+
<td>πŸ”΄ <strong>Automation</strong></td>
152+
<td>Backup scripts, cron jobs, scheduled tasks</td>
153+
<td>Advanced</td>
154+
</tr>
155+
</tbody>
156+
</table>
157+
158+
---
159+
160+
## πŸ› οΈ Usage
161+
162+
### Making a Script Executable
163+
164+
```bash
165+
chmod +x script_name.sh
166+
./script_name.sh
167+
```
168+
169+
### Running with Bash Directly
170+
171+
```bash
172+
bash script_name.sh
173+
```
174+
175+
### Passing Arguments
176+
177+
```bash
178+
./script.sh arg1 arg2
179+
# Inside script: $1 = arg1, $2 = arg2
180+
```
181+
182+
### Debugging a Script
183+
184+
```bash
185+
bash -x script.sh # Trace execution
186+
bash -n script.sh # Syntax check only
187+
```
188+
189+
---
190+
191+
## πŸ’‘ Tips & Best Practices
192+
193+
```bash
194+
# βœ… Always start with a shebang
195+
#!/bin/bash
196+
197+
# βœ… Use quotes around variables
198+
echo "$variable" # Prevents word splitting
199+
200+
# βœ… Check command success
201+
if ! mkdir /tmp/mydir; then
202+
echo "Failed to create directory"
203+
fi
204+
205+
# βœ… Use meaningful variable names
206+
user_home="$HOME"
207+
208+
# βœ… Trap errors for cleanup
209+
trap 'echo "Error on line $LINENO"' ERR
210+
```
211+
212+
| βœ… Do This | ❌ Avoid This |
213+
|---|---|
214+
| Quote your variables `"$var"` | Unquoted variables `$var` |
215+
| Use `[[` for conditionals | Use `[` without escaping |
216+
| Add `set -e` for strict mode | Silent failure on errors |
217+
| Comment your logic | Writing cryptic one-liners |
218+
| Use `local` for function vars | Global vars everywhere |
219+
220+
---
221+
222+
## 🀝 Contributing
223+
224+
Contributions are warmly welcome! πŸŽ‰
225+
226+
```bash
227+
# 1. Fork the repository
228+
# 2. Create your feature branch
229+
git checkout -b feature/my-awesome-script
230+
231+
# 3. Commit your changes
232+
git commit -m "Add: system health check script"
233+
234+
# 4. Push to your branch
235+
git push origin feature/my-awesome-script
236+
237+
# 5. Open a Pull Request
238+
```
239+
240+
### Guidelines
241+
242+
- πŸ“ Add comments to explain what your script does
243+
- πŸ§ͺ Test your script before submitting
244+
- πŸ“ Place scripts in the correct category folder
245+
- πŸ”€ Use `snake_case` for file names (e.g., `disk_usage.sh`)
246+
247+
---
248+
249+
## πŸ“„ License
250+
251+
This project is licensed under the **MIT License** β€” feel free to use, share, and modify.
252+
253+
---
254+
255+
<div align="center">
256+
257+
**Made with πŸ–€ and a lot of `$ _`**
258+
259+
[![GitHub](https://img.shields.io/badge/Follow-Kishan--Miskin-181717?style=for-the-badge&logo=github)](https://github.com/Kishan-Miskin)
260+
261+
*If this repo helped you, drop a ⭐ β€” it means the world!*
262+
263+
</div>

0 commit comments

Comments
Β (0)