📅  最后修改于: 2023-12-03 14:59:25.386000             🧑  作者: Mango
Auto Clean Ubuntu is a shell script that automates the process of cleaning up unnecessary files on Ubuntu-based systems. This script is designed to free up disk space, speed up your system and make maintenance tasks easier and more efficient.
chmod +x auto_clean_ubuntu.sh
../auto_clean_ubuntu.sh
.#!/bin/bash
# Remove old kernels
sudo apt-get autoremove
sudo apt-get autoclean
# Clean up unused packages
sudo apt-get remove --purge $(dpkg --get-selections | grep deinstall | awk '{print $1}')
# Remove unused configuration files
sudo apt-get purge $(dpkg -l | grep '^rc' | awk '{print $2}')
# Clean apt cache
sudo apt-get clean
# Remove temporary files
sudo find /var/tmp -type f -delete
sudo find /tmp -type f -delete
# Clean up thumbnails
rm -rf ~/.cache/thumbnails/*
Auto Clean Ubuntu is a simple but powerful tool that automates maintenance tasks on Ubuntu-based systems. By running this script regularly, you can keep your system running smoothly and free up valuable disk space.