Keyboard shortcut to go to the end of the history of commands in the ubuntu terminal

I searched the Internet for this without success. The question is: is there a key combination to go to the end of the command line history?

I ask because I often use the reverse i-search function Ctrl + R to quickly find the previous command in the history, but then I can change my mind and type the command from scratch without overwriting the previous command (so clear the line with Ctrl + A Ctrl + K is not an option). Thus, I want to return to the empty command line (at the end of the command history).

Now I can achieve this by scrolling through the story using the down arrow key until I am at the end of the story, but it can be painful, as I sometimes have to go through many records to achieve the goal.

+5
source share
2 answers

Ctrl + C and up arrow.
Ctrl + C → ends the current browsing history using the Up / Down key.
Up arrow key → Get last command.

+6
source

As this answer indicated, you can use Meta + < and Meta + > .

For me, under Ubuntu 16.04 with an English keyboard, this meant:

  • Beginning of the story: Alt + <
  • End of story: Shift + Alt + <

Also check this answer to understand the Meta key.

+1
source

Source: https://habr.com/ru/post/1208415/


All Articles