Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created August 11, 2009 16:58
Show Gist options
  • Select an option

  • Save btbytes/165957 to your computer and use it in GitHub Desktop.

Select an option

Save btbytes/165957 to your computer and use it in GitHub Desktop.
Debian CF Install Cleanup script
#!/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
## http://kristof.vanhertum.be/wp-content/uploads/2008/03/cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment