How to Change the Path to the Active Xcode Installation for Your Machine

I updated my Mac OS X to 10.8GM today. Everything was fine. And then update Xcode to 4.4GM for 4.3 doesn’t support 10.8. I made a mistake that I run Xcode.app in dmg file. Then a setup wizard showed up. I press next next next… Suddenly I remind I should move the app to Application folder first. But the setup wizard can’t show up again. And the path of xcode had be set to /Volumes/Xcode.app/…
How to change it to the right path? I googled it there is a command named xcode-select.

$ xcode-select
xcode-select: Error: no command option given.

xcode-select: Report or change the path to the active
Xcode installation for this machine.

Usage: xcode-select –print-path
Prints the path of the active Xcode folder
or: xcode-select –switch Sets the path for the active Xcode folder
or: xcode-select –version
Prints the version of xcode-select

$ xcode-select --print-path
/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
Everything goes fine now.