linux-shell-scripting
Create Linux Shell Scripts for Automation
Manually writing bash scripts for system administration is time-consuming and error-prone. This skill provides production-ready shell script templates for common Linux tasks including backups, monitoring, user management, log analysis, and automation.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "linux-shell-scripting". Create a backup script for /home/user/documents
Résultat attendu:
Generates a bash script that creates timestamped tar.gz backups of /home/user/documents, includes error handling for missing directories, logs backup status with timestamps, and provides usage instructions.
Utilisation de "linux-shell-scripting". Write a script to monitor disk space
Résultat attendu:
Produces a monitoring script using df command to check disk usage, allows configurable threshold percentage (default 90%), sends alert notifications when threshold exceeded, and can be run via cron for automated monitoring.
Utilisation de "linux-shell-scripting". Create user account automation
Résultat attendu:
Delivers a bash script that checks for existing user accounts using id command, creates new users with home directory via useradd, sets initial passwords using passwd, and includes logging for audit trails.
Audit de sécurité
SûrStatic analysis detected 170 patterns in SKILL.md markdown documentation. All findings are false positives - they represent bash code examples within markdown code blocks, not executable code. The skill provides legitimate educational shell scripting templates for system administration tasks. No malicious intent or execution vectors found.
Facteurs de risque
⚙️ Commandes externes (26)
🌐 Accès réseau (2)
📁 Accès au système de fichiers (5)
Score de qualité
Ce que vous pouvez construire
Automated Backup Systems
System administrator needs scheduled backup scripts for databases and directories with automatic rotation to prevent disk space issues.
Server Monitoring Dashboards
DevOps engineer requires resource monitoring scripts that track CPU, disk, and memory usage with alerting capabilities.
Security Audit Automation
Security analyst needs scripts to automate user management, password expiry checks, and log analysis for compliance reporting.
Essayez ces prompts
Create a bash script that backs up the /var/www directory to /backup with a timestamp. Keep only the last 7 backups and delete older ones automatically.
Write a monitoring script that checks CPU and disk usage every 5 minutes. Send an email alert if CPU exceeds 80% or disk usage goes above 90%. Log all checks to /var/log/monitor.log
Create a script that encrypts all files in /data/sensitive using AES-256 encryption. The script should accept a password from stdin, encrypt files with .enc extension, and verify the encrypted files can be decrypted.
Build a comprehensive log analyzer for Apache/Nginx access logs. Extract top 20 IP addresses by request count, identify suspicious patterns (404 errors, SQL injection attempts), and generate daily HTML reports saved to /var/log/reports.
Bonnes pratiques
- Always test scripts in a non-production environment first to verify behavior and prevent data loss
- Use absolute paths instead of relative paths in scripts to avoid execution context issues
- Quote all variable references to handle filenames with spaces and special characters properly
- Enable bash debugging mode with 'set -x' during development and 'set -e' to exit on errors
Éviter
- Avoid using eval command or unquoted variable interpolation which can lead to code injection vulnerabilities
- Never hardcode passwords or API keys in scripts - use environment variables or secure credential managers instead
- Do not skip error checking - always verify command exit codes using $? or set -e for proper error handling
- Avoid removing files with rm -rf without confirmation checks and explicit path validation