Skip to content

Instantly share code, notes, and snippets.

@xacrimon
Last active January 25, 2018 15:25
Show Gist options
  • Save xacrimon/8b722eaa1cf56c234cfd6fa7a566d5b8 to your computer and use it in GitHub Desktop.
Save xacrimon/8b722eaa1cf56c234cfd6fa7a566d5b8 to your computer and use it in GitHub Desktop.
A script to clean the system of logs and caches for arch linux, adjust the username for the homedir accordingly
#!/bin/sh
user1=archie
if [[ $(whoami) != "root" ]]
then echo "Run as root"
exit 1
fi
if [ "$(ls /bin | grep trizen)" == "trizen" ]
then
PKGMAN=trizen
else
PKGMAN=pacman
fi
echo "Cleaning..."
${PKGMAN} -Scc
rm -r /root/.cache
rm -r /home/archie/.cache
rm -r /var/log/journal/*
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment