Skip to content

Instantly share code, notes, and snippets.

@Ne00n
Last active December 7, 2019 11:23
Show Gist options
  • Save Ne00n/723841287cd33637db885300f1f116d3 to your computer and use it in GitHub Desktop.
Save Ne00n/723841287cd33637db885300f1f116d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
#apt
apt-get install curl
apt-get autoremove
apt-get autoclean
apt-get clean
#tmp
rm -rf /tmp/*
rm -rf /var/tmp/*
#logs
cat /dev/null > /var/log/syslog
cat /dev/null > /var/log/debug
cat /dev/null > /var/log/lastlog
cat /dev/null > /var/log/messages
cat /dev/null > /var/log/user.log
cat /dev/null > /var/log/kern.log
cat /dev/null > /var/log/dpkg.log
cat /dev/null > /var/log/daemon.log
cat /dev/null > /var/log/alternatives.log
cat /dev/null > /var/log/btmp
cat /dev/null > /var/log/wtmp
cat /dev/null > /var/log/bootstrap.log
cat /dev/null > /var/log/cloud-init.log
cat /dev/null > /var/log/tallylog
cat /dev/null > /var/log/faillog
cat /dev/null > /var/log/audit/audit.log
cat /dev/null > /var/log/tuned/tuned.log
cat /dev/null > /var/log/secure
cat /dev/null > /var/log/hawkey.log
cat /dev/null > /var/log/dnf.l
cat /dev/null > /var/log/dnf.log
cat /dev/null > /var/log/dnf.librepo.log
cat /dev/null > /var/log/dnf.rpm.log
cat /dev/null > /var/log/cron.log
cat /dev/null > /var/log/cron
cat /dev/null > /var/log/boot.log
rm /var/log/btmp.*
cat /dev/null > /var/log/auth.log
rm /var/log/*.log.*
rm /var/log/apt/*.*
cat /dev/null > /var/log/dmesg
rm /var/log/dmesg.*
rm -r /var/log/installer
rm ~/.bash_history
history -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment