This file contains hidden or 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
#!/usr/bin/env bash | |
# Ubuntu Server or VM Cleaner. Safe by default; aggressive when asked. | |
# Example safe: sudo ./clean.sh | |
# Example aggressive: sudo JOURNAL_DAYS=3 AGGRESSIVE=1 ./clean.sh | |
# Enable Docker image prune (images only): sudo ./clean.sh --docker-images | |
# Tested on Ubuntu 20.04, 22.04, 24.04 (server/VM images). | |
set -Eeuo pipefail | |
trap 'rc=$?; echo "Error on line $LINENO: $BASH_COMMAND (exit $rc)"; exit $rc' ERR | |
IFS=$'\n\t' |
This file contains hidden or 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 | |
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux | |
## By Philipp Klaus | |
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/> | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "You have to run this script as Superuser!" | |
exit 1 | |
fi |