- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCleanMacCache
More file actions
Latest commit
41 lines (33 loc) · 975 Bytes
/
Copy pathCleanMacCache
File metadata and controls
41 lines (33 loc) · 975 Bytes
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
#!/bin/bash
# Clean Mac logs and caches
#user cache file
echo"cleaning user cache file from ~/Library/Caches"
rm -rf ~/Library/Caches/*
#user logs
echo"cleaning user log file from ~/Library/Logs"
rm -rf ~/Library/Logs/*
#system caches
echo"cleaning system caches"
sudo rm -rf /Library/Caches/*
#system logs
echo"cleaning system logs from /Library/Logs"
sudo rm -rf /Library/Logs/*
echo"cleaning system logs from /var/log"
sudo rm -rf /var/log/*
echo"cleaning from /private/var/folders"
sudo rm -rf /private/var/folders/*
#ios photo caches
echo"cleaning ios photo caches"
rm -rf ~/Pictures/iPhoto\ Library/iPod\ Photo\ Cache/*
#application caches
echo"cleaning application caches"
forxin$(ls ~/Library/Containers/)
do
echo"cleaning ~/Library/Containers/$x/Data/Library/Caches/"
rm -rf ~/Library/Containers/$x/Data/Library/Caches/*
done
# Cleaning up brew cache
echo"cleaning brew cache"
brew cleanup
echo
echo"Cache cleanup process completed"