Move the OS X Terminal cursor position by clicking the mouse
If you've ever had to edit a long command in an OS X Terminal window, chances are you probably moved the cursor to the position the edit was required using the arrow keys.
If so, then you're also probably all too aware that navigating the Terminal using just the arrow keys can be a frustrating and slow process.
Fortunately, there is a little known trick that allows you to position the Terminal cursor using your mouse, just like you would in a normal text document.
Simply hold down the
Alt key on your Mac's keyboard. The Terminal cursor should turn into a crosshair, and you can now click the mouse anywhere on the current line within Terminal to move the cursor to that position.
More Terminal Shortcuts
While we're at it, here are a few more time saving shortcuts for positioning the cursor or editing the text around the current cursor position:
A Go to the beginning of the line you are currently typing on
E Go to the end of the line you are currently typing on
U Clears the line before cursor position (or the entire line if you are at the end of the line)
H Alternative to using backspace
W Delete the word before the cursor
K Clear the line after the cursor
T Swap the last two characters before the cursor
T Swap the last two words before the cursor
F Move cursor forward one word on the current line
B Move cursor backward one word on the current line
These commands should work using the default OS X Terminal (Bash), however if you're using a third party Terminal like iTerm then it will likely have its own set of shortcuts for performing the above actions.