This repository contains a curated collection of essential shell scripts written for DevOps use cases — from Linux fundamentals to advanced automation.
Each script is lightweight, reusable, and can be integrated into CI/CD pipelines, cron jobs, or system monitoring workflows.
| No | Script Name | Description |
|---|---|---|
| 1️⃣ | count_words.sh |
Reads a text file and counts the occurrences of each word, showing the most frequent ones. |
| 2️⃣ | prime_number.sh |
Checks if a given number is prime. |
| 3️⃣ | palindrome_check.sh |
Verifies whether a given string is a palindrome. |
| 4️⃣ | count_vowels.sh |
Counts the number of vowels in a given input string or sentence. |
| 5️⃣ | even_or_odd.sh |
Determines whether a given number is even or odd. |
| 6️⃣ | factorial.sh |
Calculates the factorial of a given number using loops. |
| 7️⃣ | sum_of_digits.sh |
Finds the sum of digits of a given number. |
| 8️⃣ | reverse_number.sh |
Reverses a given number (e.g., 123 → 321). |
| 9️⃣ | fibonacci_series.sh |
Generates the first N Fibonacci numbers. |
| 🔟 | disk_usage_monitor.sh |
Checks storage utilization and alerts when disk usage exceeds a set threshold. |
| 1️⃣1️⃣ | cpu_memory_monitor.sh |
Monitors CPU and memory usage in real time and logs the output. |
| 1️⃣2️⃣ | service_uptime_checker.sh |
Verifies if critical services (nginx, docker, mysql) are running; restarts or alerts if down. |
| 1️⃣3️⃣ | docker_cleanup.sh |
Cleans up unused Docker containers, images, and volumes to free space. |
| 1️⃣4️⃣ | log_cleanup.sh |
Deletes log files older than N days to manage disk storage efficiently. |
| 1️⃣5️⃣ | backup_rotation.sh |
Automates daily and weekly backups and deletes old backups based on retention rules. |
| 1️⃣6️⃣ | server_health_check.sh |
Checks key server parameters like uptime, load average, and available disk/memory. |
| 1️⃣7️⃣ | system_resource_check.sh |
Prints system performance summary — CPU, memory, disk, and network stats. |
| 1️⃣8️⃣ | disk_alert.sh |
Sends an alert if disk usage crosses a critical limit. |
1️⃣ Clone this repository:
git clone https://github.com/prashanthteja139/Important_Scripts.git
cd Important_Scripts
2️⃣ Make a script executable:
bash
Copy code
chmod +x script_name.sh
3️⃣ Run it:
bash
Copy code
./script_name.sh
⏰ Automate with Cron (Optional)
Example: run log cleanup daily at 2 AM
bash
Copy code
0 2 * * * /path/to/log_cleanup.sh
🧩 Learning Focus
Each script was written as part of my DevSecOps learning journey — covering:
Linux fundamentals
Scripting logic
Process monitoring
System automation
Cloud and container housekeeping
👨💻 About the Author
Prashanth Teja
🔹 DevOps | DevSecOps Enthusiast | Ex-Amazon
🔹 Passionate about automation, CI/CD, and cloud infrastructure
🔹 Learning in public and sharing scripts to help others build DevOps muscle