Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting text in terminal without using the mouse

If I'm working in a terminal window in Linux, is there a keyboard shortcut I can use to select output displayed on previous lines? If I select something with the mouse I can copy using Ctrl + Shift + C, but is there a way to select without using the mouse at all. I'm using either Gnome terminal or KDE konsole in Ubuntu desktop.

For example I often need to copy results from a mysql query and then google them.

like image 382
annavt Avatar asked Oct 08 '09 09:10

annavt


People also ask

How do you highlight text in terminal with keyboard?

shift + ← or shift + → to highlight text. shift + ctrl + ← or shift + ctrl + → to highlight an entire word.

How do I select and copy text in Linux terminal without mouse?

Method 1: Using keyboard shortcuts for copy pasting in the terminal. On Ubuntu and many other Linux distributions, you can use Ctrl+Insert or Ctrl+shift+C for copying text and Shift+Insert or Ctrl+shift+V for pasting text in the terminal. The copy pasting also works for the external sources.

How do I open a terminal without a mouse?

Use Alt + F2 to access the keyboard Preferences. Or use Alt+F1 to access the main menu then navigate to system.


2 Answers

You can use the screen application and enter copy mode with Ctrl+a, Esc. Start selecting text with Space and end selecting text with Space. Insert text with Ctrl+a, ]

like image 173
knittl Avatar answered Oct 12 '22 14:10

knittl


Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.

like image 42
Niko Avatar answered Oct 12 '22 13:10

Niko