It often happens that you type a command in a Mac terminal and have to make changes to the command. You then return character-by-character to edit the command so that you can execute it. Although character-specific movement of a Terminal command can be done using the arrow keys on the keyboard, moving a cursor from word to word requires a different key combination.
The advantage of being able to move the cursor over words is that you can go very far in a command with a few keystrokes. Here’s how to do it in a Mac terminal.
Move the cursor from word to word in Mac Terminal
1. Start the Terminal on the Mac.
2. Type a command in a terminal that contains a few words to perform this operation.
Once the command is given, you can use the following keys to move forward or backward from word to word:
Esc + B – moves the cursor back one word
Esc + F – moves the cursor one word forward
The keystrokes above should work on almost all Unix-based terminals. But you also have Mac-specific key combinations that allow you to move the cursor in the same way as above. These are:
Option + left arrow – moves the cursor back one word
Option + right arrow – move the cursor one word forward
This allows you to move forward or backward in the Mac terminal. If Terminal is an application you use often, the tip above should make your job a little easier.