⌘→Move to end of line.⌘←Move to beginning of line⌥→Move to beginning of next word⌥←Move to beginning of previous word
This is normal for Mac text processing, but not default in Terminal or iTerm2.
I haven't looked at how to enable this for Terminal, but for iTerm2:
- Open iTerm Preferences (
⌘,) - Go to the "Keys" tab
- Add the following entries:
⌘→Send Hex Code:0x05⌘←Send Hex Code:0x01⌥→Send Escape Sequence:f⌥←Send Escape Sequence:b