Rectangle is rec
Undo is u (plus standard windows type keyboard shortcut ctrl z)
Redo is r (plus standard windows type keyboard shortcut ctrl y)
By "distance" do you mean the snap option? sd toggles this on and off
For measuring "distance" point to point you can use the dpp command