Heads up—I’ve noticed some weirdness if I try to do this when my Terminal window is small enough that the command flows onto multiple lines.
If that happens to you, just embiggen your window, and you’ll be fine.
Another happy little trick is that you can use Option paired with the left or right arrow key to jump between sections of your typed command (sadly, this is Lion- and Mountain Lion-only). Here’s an example of all the places that your cursor will leap to if you start at the line’s end and continue pressing Option–Left Arrow:
No mouse or trackpad required for that!
And finally, if you’d like to jump right to the beginning or the end of a line in Terminal, use Control-A (beginning) or Control-E (end). Pretty handy stuff if you use Terminal a lot! Or handy even if you know nothing about Terminal and just want to pretend to be a command-line wizard to impress your mom.