-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleaner.sh
More file actions
57 lines (44 loc) · 1.46 KB
/
Copy pathcleaner.sh
File metadata and controls
57 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Define directories to clean
temp_dirs=("/tmp" "/var/tmp" "$HOME/.cache")
# Colors for output
GREEN="\e[32m"
RED="\e[31m"
YELLOW="\e[33m"
BLUE="\e[34m"
RESET="\e[0m"
# Cool banner
echo -e "${YELLOW}========================================="
echo -e "${GREEN}🧹 Ultimate System Cleaner 🚀"
echo -e "${YELLOW}=========================================${RESET}"
# Ask for confirmation before proceeding
echo -e "${YELLOW}This script will remove temporary files, logs, cache, and more.${RESET}"
read -p "Do you want to proceed? (y/n): " confirm
if [[ "$confirm" != "y" ]]; then
echo -e "${RED}Operation canceled.${RESET}"
exit 1
fi
# Remove temp files
for dir in "${temp_dirs[@]}"; do
echo -e "${GREEN}Cleaning $dir...${RESET}"
sudo rm -rf "$dir"/*
done
# Clear APT cache
echo -e "${GREEN}Cleaning APT cache...${RESET}"
sudo apt clean -y
# Remove orphaned packages
echo -e "${GREEN}Removing orphaned packages...${RESET}"
sudo apt autoremove -y
# Clear systemd journal logs
echo -e "${GREEN}Clearing system logs...${RESET}"
sudo journalctl --vacuum-time=3d
# Empty trash bin
echo -e "${GREEN}Emptying trash bin...${RESET}"
sudo rm -rf ~/.local/share/Trash/*
# Sync filesystem
echo -e "${BLUE}Syncing filesystem to ensure cleanup...${RESET}"
sync
# Final success message
echo -e "${GREEN}✅ System cleanup complete! Your system is now faster and more efficient.${RESET}"
echo -e "${YELLOW}🎉 Enjoy your clean system! 🎉${RESET}"
# MADE WITH LOVE BY M.A