2

For example:

% grep my_words /xx/xx/xx/xx/xx/xx/xx/xx/name.txt

When I am the end of the command line, I often need to jump to the beginning, i.e. before grep or after the grep command. I have to move backward character by character, and it's very slow.

How to do that?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
marlon
  • 6,029
  • 8
  • 42
  • 76
  • 1
    Press Ctrl+A to jump to the beginning of the commnad and Ctrl+E to the end. Did you try? – αғsнιη Feb 18 '22 at 22:12
  • @αғsнιη Ctrl+A and E works. Is there a one button that works? – marlon Feb 18 '22 at 22:27
  • Does this answer your question? [Fastest way(s) to move the cursor on a terminal command line?](https://stackoverflow.com/questions/657130/fastest-ways-to-move-the-cursor-on-a-terminal-command-line) – Laurel Feb 22 '22 at 00:05
  • If you want to move word by word: Move the insertion point forward one word : Option-Right Arrow. Move the insertion point backward one word : Option-Left Arrow. – Supertech Feb 22 '22 at 01:39

2 Answers2

0

You can simply click the home key to move the cursor to the start of the command.

0

On Mac you can use the combination:
ctrl + A

Thunermay
  • 194
  • 1
  • 12