Created
June 18, 2024 16:49
-
-
Save ppcdias/a2bdd5ed5481a1d5074e56d120265f79 to your computer and use it in GitHub Desktop.
WHM/cPanel Useful Terminal Commands for Managing and Optimizing Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List All error_log Files | |
find /home/*/public_html -type f -name error_log -exec du -sh {} \; | |
# Clear All error_log Files | |
find /home/*/public_html -type f -iname error_log -delete | |
# Import a .sql File into a MySQL Database | |
mysql -u root -p dbname < /home/username/database.sql | |
# Get a List of the Most Frequent IP Addresses in Apache Logs | |
cat /usr/local/apache/logs/access_log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 20 | |
# Execute a cPanel Backup Immediately | |
/usr/local/cpanel/bin/backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment