Find the answer to your Linux question:
Results 1 to 2 of 2
My situation is basically say you are typing out a long string of command on the terminal. You realize there is a typo in the middle of the command. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    3

    Is there a shortcut key to get to the middle of your command?


    My situation is basically say you are typing out a long string of command on the terminal. You realize there is a typo in the middle of the command. I know CTRL + A can bring you to the front, and CTRL + E can bring you to the end. Is there a command that bring you to the middle?

  2. #2
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    Negative. However if you issue a 'man bash' you can see what is supported for command line moving. Here is a snippet.

    Commands for Moving
    beginning-of-line (C-a)
    Move to the start of the current line.
    end-of-line (C-e)
    Move to the end of the line.
    forward-char (C-f)
    Move forward a character.
    backward-char (C-b)
    Move back a character.
    forward-word (M-f)
    Move forward to the end of the next word. Words are composed of alphanumeric characters (letters and digits).
    backward-word (M-b)
    Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and dig‐
    its).
    shell-forward-word
    Move forward to the end of the next word. Words are delimited by non-quoted shell metacharacters.
    shell-backward-word
    Move back to the start of the current or previous word. Words are delimited by non-quoted shell metacharacters.
    clear-screen (C-l)
    Clear the screen leaving the current line at the top of the screen. With an argument, refresh the current line without
    clearing the screen.
    redraw-current-line
    Refresh the current line.
    <note>I might have missed some other way to do this deeper in the bash man page but didn't see anything.</note>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •