How can I stop the shell command `mate` from opening Textmate 1.x instead of Textmate2? I've installed mate in the preferences pane in TextMate2. It says "Shell support installed." I added the string export EDITOR="/usr/local/bin/mate -w" to ~/.bashrc as instructed.

However, when I use the mate command, Textmate 1 launches, for example if I type mate test.txt in the Terminal. I would like it to launch TextMate2.

Ideally, I'd like to keep TM1 around, as it does a few things that TM2 doesn't yet do. But if scrapping TM1 is the only/best option, that'd be useful to know, too.
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