Skip to content

Instantly share code, notes, and snippets.

@int0x33
Created February 14, 2019 11:38
Show Gist options
  • Select an option

  • Save int0x33/77550aac697d125a72709abcdb06b85a to your computer and use it in GitHub Desktop.

Select an option

Save int0x33/77550aac697d125a72709abcdb06b85a to your computer and use it in GitHub Desktop.
function clearlogs {
find /var/log -type f
}
for i in return $(clearlogs);
do sudo cat /dev/null > $i;
echo "Log $i has been cleared";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment