Skip to content

Instantly share code, notes, and snippets.

@michaelaguiar
Last active August 27, 2018 12:58
Show Gist options
  • Save michaelaguiar/90cfd7e523399fc76eb2 to your computer and use it in GitHub Desktop.
Save michaelaguiar/90cfd7e523399fc76eb2 to your computer and use it in GitHub Desktop.
Clean up disk space - Ubuntu
# Show top 10 biggest subdirs in the current dir.
du -sk * | sort -nr | head -10
# Check if you have old kernels for deletion
ls -lh /boot
# Cleaning packages
sudo apt-get autoremove
sudo apt-get autoclean
# View list of all installed packages, sorted by size. If you see something big and don't use it - uninstall it
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
# Check content of /var/tmp/
du -sh /var/tmp/
# Check deborphan
man deborphan
# Search for large files
find / -type f -size +1024k
# or
find / -size +50000 -exec ls -lahg {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment