#!/bin/bash function doc() { echo "Removing documentation ..." find / -type d -regex '.*\(/doc/\|/info/\).*' -exec rm -r {} \; 2>/dev/null } function man() { echo "Removing man pages ..." find / -type d -regex '.*\(/man/\).*' -exec rm -r {} \; 2>/dev/null } function deb() { echo "Removing Debian packages and cleaning apt-cache ..." find / -type f -regex '.*\(\.deb$\).*' -exec rm -r {} \; 2>/dev/null rm /var/cache/apt/*.bin rm /var/lib/apt/lists/*dists* } if [ $# -ne 1 ]; then echo "Usage: $0 doc|man|deb|all" exit 1 fi if [ $1 == "all" ]; then echo "remove all" doc man deb else eval \$1 fi