A collection of practical Bash scripting projects, exercises, and reference materials covering Linux automation, system administration, log analysis, backup automation, scheduling, and shell scripting fundamentals.
This repository documents my hands-on journey learning Bash scripting through real-world projects and automation tasks. The scripts focus on practical Linux administration, DevOps automation, error handling, reporting, and system maintenance.
Shell-Scripts/
├── Shell Scripting Basics/
├── Shell Scripting Loops Arguments Error Handling/
├── Shell Scripting Functions intermediate Concepts/
├── Shell Scripting Project Log Rotation Backup Crontab/
├── Bash Scripting Challenge Log Analyzer and Report/
├── Shell Scripting Cheat Sheet Build Your Own Reference Guide/
└── README.md
- Shebang and script execution
- Variables and quoting
- User input handling
- Conditional statements
- File operations
- Service status checks
- For loops
- While loops
- Command-line arguments
- Package installation automation
- Error handling techniques
- Root privilege validation
- Function creation and usage
- Function arguments
- Return values
- Local variables
- Strict mode (
set -euo pipefail) - System information reporting
- Automated log rotation
- Backup automation
- Archive management
- Scheduled maintenance
- Cron job configuration
- Production-style automation
- Log file validation
- Error detection
- Critical event extraction
- Error statistics
- Report generation
- Linux text processing tools
- Bash syntax reference
- Loops and conditionals
- Functions
- Text processing commands
- Error handling
- DevOps one-liners
Collects and displays:
- Hostname and OS information
- System uptime
- Disk usage statistics
- Memory utilization
- Top CPU-consuming processes
Automatically:
- Checks installed packages
- Installs missing packages
- Validates root privileges
- Reports installation status
Features:
- Compresses old log files
- Removes outdated archives
- Tracks processed files
- Provides execution reports
Features:
- Creates timestamped backups
- Verifies archive integrity
- Cleans up old backups
- Reports backup statistics
Combines:
- Log rotation
- Backup operations
- Timestamped logging
- Cron scheduling
Provides:
- Error counting
- Critical event detection
- Top error summaries
- Daily report generation
- Bash Scripting
- Linux Administration
- Process Automation
- Log Analysis
- Backup Management
- Task Scheduling
- Text Processing
- Error Handling
- System Monitoring
- DevOps Fundamentals
- Bash
- grep
- awk
- sed
- cut
- sort
- uniq
- find
- tar
- gzip
- cron
- systemctl
- df
- free
- ps
Through these projects I gained practical experience with:
- Writing modular and maintainable Bash scripts
- Automating repetitive Linux administration tasks
- Processing and analyzing log files
- Implementing backup and recovery procedures
- Creating scheduled maintenance workflows
- Applying production-safe scripting practices
- Using Linux text-processing utilities effectively
Khalid Khan
Linux System Administrator | DevOps Engineer
GitHub: https://github.com/krmaryum
LinkedIn: https://www.linkedin.com/in/khalid-khan-93760a360
This repository is created for learning, practice, and demonstration purposes.