keyboard shortcuts for moving cursor on command line

Move the cursor to the start of the line. Ctrl + a
Move the cursor to the end of the line. Ctrl + e
Move the cursor one word forward. Meta + f
Move the cursor one word backward. Meta + b
Cut from cursor to the end of line. Ctrl + k
Cut from cursor to the end of word. Meta + d
Paste the previously cut text. Ctrl + y
Undo Ctrl + –

Meta is the Alt or esc key on the keyboard. On mac os, you can enable the alt key on terminal by
1. open the terminal
2. Click Terminal dropdown menu
3. Preferences.
4. Check the box before Use option as meta key

Search within Codexpedia

Custom Search

Search the entire web

Custom Search