How can I stop the shell command `mate` from opening Textmate 1.x instead of Textmate2?
You need to replace the symlink path in /usr/local/bin/mate to Textmate2

//go to the bin directory
cd /usr/local/bin

//delete the existing symlink
rm -rf mate

//create the symlink to the Textmate 2 mate executable
ln -s /Applications/TextMate2.app/Contents/Resources/mate mate