-
-
Save soundyogi/ee05c1e17f17a4e3b6a03c01c63dc734 to your computer and use it in GitHub Desktop.
Script to clean up Ubuntu
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
#!/bin/bash | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} | |
print_green 'Start' | |
print_green 'Cleanup log files' | |
find /var/log -type f | while read f; do echo -ne '' > $f; done | |
print_green 'Cleanup bash history' | |
unset HISTFILE | |
[ -f /root/.bash_history ] && rm /root/.bash_history | |
[ -f /home/ubuntu/.bash_history ] && rm /home/ubuntu/.bash_history | |
print_green 'Cleanup complete!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment