Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'How to move cursor a line at a time?' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
How to move cursor a line at a time?
Authored by: steresi on Fri, Aug 31 2007 at 2:00PM PDT
I often have a long command on the command line and would like to move through it by "lines" (say, about 130 characters). If I have a command that spans 3 or 4 lines in Terminal, is there any way to move right to the middle of it, or move back 100 characters at a time?

[ Reply to This | # ]
How to move cursor a line at a time?
Authored by: boxcarl on Fri, Aug 31 2007 at 2:28PM PDT
How to move cursor a line at a time?
Authored by: brettmjohnson on Sat, Sep 1 2007 at 1:34PM PDT
... is there any way to move right to the middle of it, or move back 100 characters at a time?"

Bash uses readline as its command line editor. Nearly every readline command may be preceded with a numeric multiplier argument. For instance, M-4 M-f moves forward 4 words, and M-100 C-b moves backward 100 characters.

As mentioned previously, if you don't have a Meta key mapped, use Esc instead.

[ Reply to This | # ]

How to move cursor a line at a time?
Authored by: steresi on Mon, Sep 3 2007 at 10:47PM PDT
Excellente!!!

[ Reply to This | # ]
How to move cursor a line at a time?
Authored by: bryanc on Thu, Sep 6 2007 at 4:14PM PDT
If your commands are that long, you might also find it useful to edit the current command-line in your default text editor. Just press C-x C-e.

When you quit the editor the command is executed as normal.

(You can change the editor used by setting the $EDITOR environment variable, it uses emacs by default I think).

If you use vi-mode for the shell, the keybinding is esc-v. (or just v if your not in insert mode).

[ Reply to This | # ]