This repository was archived by the owner on Aug 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathscript.sh
More file actions
59 lines (53 loc) Β· 1.8 KB
/
script.sh
File metadata and controls
59 lines (53 loc) Β· 1.8 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
58
59
#!/bin/bash
echo "Running Clean Your Mac Script π"
echo -n "Do you want to perform Brew πΊ tasks(y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
#Updating brew
echo "Updating Brew πΊ and Cleaning up the Cask π. This might take some time depending upon your network connection and packages installed."
brew update
brew cask update
brew upgrade
brew cleanup
brew cask cleanup
brew doctor
fi
#user cache file
echo "Cleaning user cache file from ~/Library/Caches"
sudo rm -rf ~/Library/Caches/*
echo "β
Done Cleaning from ~/Library/Caches"
#user logs
echo "Cleaning user log file from ~/Library/logs"
sudo rm -rf ~/Library/logs/*
echo "β
Done Cleaning from ~/Library/logs"
#user preference log
echo "Cleaning user preference logs"
rm -rf ~/Library/Preferences/*
echo "β
Done Cleaning from /Library/Preferences"
#system caches
echo "Cleaning system caches"
sudo rm -rf /Library/Caches/*
echo "β
Done Cleaning system cache"
#system logs
echo "Cleaning system logs from /Library/logs"
sudo rm -rf /Library/logs/*
echo "β
Done Cleaning from /Library/logs"
echo "Cleaning system logs from /var/log"
sudo rm -rf /var/log/*
echo "β
Done Cleaning from /var/log"
echo "Cleaning from /private/var/folders"
sudo rm -rf /private/var/folders/*
echo "β
Done Cleaning from /private/var/folders"
#ios photo caches
echo "Cleaning ios photo caches"
rm -rf ~/Pictures/iPhoto\ Library/iPod\ Photo\ Cache/*
echo "β
Done Cleaning from ~/Pictures/iPhoto Library/iPod Photo Cache"
#application caches
echo "Cleaning application caches"
for x in $(ls ~/Library/Containers/)
do
echo "Cleaning ~/Library/Containers/$x/Data/Library/Caches/"
rm -rf ~/Library/Containers/$x/Data/Library/Caches/*
echo "β
Done Cleaning ~/Library/Containers/$x/Data/Library/Caches"
done
echo "β
Done Cleaning for application caches"