Possible Duplicate:
How can I move around the bash commandline efficiently?

I asked the case of cmd.exe here. I want to ask the same question for Mac's Terminal/bash. I know some of the answers, but not everything.

With Terminal/bash, when something's wrong with what I typed? What edit option can I do? I can use arrow key to move cursor one by one, but it would be great if there's a key for

  • Move the cursor by the word not by character both directions (forward/backward)
  • Move the cursor to the start of line
    • I use Control-A
  • Move the cursor to the end of line
    • I use Control-E
  • Delete the word (not a character) under the cursor.
    • I use Escape-Delete key for this purpose.

Or, what would be other useful keys for editing?

link|improve this question

74% accept rate
possible duplicate of How can I move around the bash commandline efficiently?. In particular, one of the answers to that question includes a link to this page. – Dennis Williamson Sep 28 '10 at 15:35
feedback

closed as exact duplicate by Dennis Williamson, random Sep 28 '10 at 23:20

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

Start 'Terminal'. On the Main Menu, select Help->Terminal Help->Shortcuts for Terminal. This will bring up a page describing the keyboard shortcuts that 'Terminal' understands. Additional information can be found by starting 'Terminal', then typing "info bash ", then typing "n" until you get to the section entitled "Command Line Editing". Happy reading...

link|improve this answer
feedback

Another great one at the Terminal is holding the option (a.k.a. alt) key and then clicking into the location you want to go back to.

When you hold down the option key you will see a + cursor to let you know that you have activated the feature.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.