2

I know there is a shortcut to copy and paste contents in a Linux terminal. In addition, you can scroll through the contents of a terminal window by using Shift+PgUp and Shift+PgDown.

But is there any shortcut to select text or highlight text in a terminal without using a mouse? Unfortunately, I could not find an answer to this question; that is why I am asking here.

To clarify, I wanted to know about a keyboard command that will scroll through the terminal contents or output in the terminal. And it does not have to be a Gnome terminal; it should be some universal command for all kinds of the terminal. Like selecting the ID of a docker container after building the image.

2

2 Answers 2

1

Have a look at tmux.

The default shortcut to enter "copy mode" in tmux is Ctrl-b [, from where you use Vim-like shortcuts to select and yank text and to paste you use Ctrl-b ].

3
  • I was looking for some command that will be universal for all terminal emulators, like Konsole, Gnome terminal and the list goes on.
    – lone wolf
    Oct 29, 2021 at 12:02
  • tmux is independent of a terminal emulator. It is a terminal multiplexer. Oct 29, 2021 at 12:08
  • indeed, and screen has a similar thing. and they're great, because if you accidentally close the window, you just open it back up like nothing happened
    – Fox
    Oct 29, 2021 at 15:23
1

Selecting text can be a function of your shell or of the of the terminal emulator you are using. Alacritty is one that supports vi-like text selection with keyboard shortcuts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .