Shortcut to multiple commands for cleanup 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)?
You have a couple of options to do this....
Create a bash script.
#!/bin/bash
rm -rf ~/Library/Logs/* ~/Library/Caches/
sudo rm -rf /Library/Logs/* /Library/Caches/*

Assuming you've named it &quot;cleanup&quot; first make sure you set it to be executable:  chmod +x cleanup.
Then put it in one of the directories in your PATH by copying it or symlinking it:  cp cleanup /usr/local/bin or ln -s ./cleanup /usr/local/bin/cleanup
Make an alias
alias cleanup=&quot;rm -rf ~/Library/Logs/* ~/Library/Caches/; sudo rm -rf /Library/Logs/* /Library/Caches/*&quot;

Put that alias in your ~/.bash_profile so it's set every time you start a Terminal session.
Now that it's an alias, you can execute the command cleanup from Terminal and it will run those two commands.