To clean up cache and log files, I prefer to run following commands via terminal on daily basis (once a day, mostly in morning).
rm -rf ~/Library/Logs/* ~/Library/Caches/*
sudo rm -rf /Library/Logs/* /Library/Caches/*
I want to make a shortcut for above commands. I was thinking of putting them into a file (say, cleanup
) where above and other similar commands are listed on seperate lines. Wheneven, I want to run above commands, it should be simpler command like run cleanup
.
Is this possible? Also, can I put something like this when system starts (post booting)?
launchd
. See this answer and this answer for more details.