Use && to Chain Shell Commands Together

I bounce between 2 versions of cakephp - some projects are still on 1.2. 

I use a git checkout of the project. Sick of always having to cd ~/Sites/cake and then git co cakephp1.X, even with completion.

Simple solution. In most shells, you can chain commands together using &&, so it’s simple enough to make an alias to combine the commands. takes 1 min. You can apply this to all sorts of everyday tasks.

So, open your .bashrc (or wherever you prefer to put your shell aliases) and add (for example)

alias cake12='cd ~/Sites/cake && git co cakephp1.2 && cd -'
alias cake13='cd ~/Sites/cake && git co cakephp1.3 && cd -'

Breaking this example down: switch to cakephp directory, checkout version X, and the cd - takes us back to the previous directory.