Before you go marking this as a dupe, I know about Ctrl+Shift+C and Ctrl+Shift+V
I try to use them, and it doesn't work. On one particular Ubuntu computer, normal copy paste commands do not work: They do not work locally, and they do not work via remote session.
My guess was that perhaps logging into a computer where these functions where acting normally, and logging in via ssh would bypass the issue. This was not the case. I still cannot gain this functionally, even though the Ubuntu PC I am using has functional copy and paste from the terminal.
So I am out of guesses.
How do I enable this? The affected computer runs Ubuntu MATE 16.04. The terminal is mate-terminal, except when I login via ssh, in which case it's Bash. Caja is the window manager.
There are different ways to mark/copy and paste in linux. One of them works in all terminal emulators that I know, including
xterm
.1. The linux mark and paste method - 'middle clicking'
Mark the text, that you want to paste by pressing the left mouse button and move the mouse. (You can left click twice to mark a word or three times to mark a line.)
Move the mouse cursor to where you want to paste the text.
Press the middle button or scrolling wheel (like it were a button). If no middle button, press the left and right buttons at the same time.
In a terminal window, the text will be pasted at the cursor position. This works in the same terminal window, in another terminal window as well as in other programs, for example Firefox and gedit.
2. A method that works in many but not all terminal windows
2.1 Via menus
Mark the text, that you want to paste by pressing the left mouse button and move the mouse.
Use a pull-down or right-click menu and select 'Copy' (to clipboard).
Move the mouse cursor to where you want to copy the text.
Use a pull-down or right-click menu and select 'Paste'
2.2 hotkey combination with
ctrl
Mark the text, that you want to paste by pressing the left mouse button and move the mouse.
Press shift + ctrl + c to 'Copy' (to clipboard).
Press shift + ctrl + v to 'Paste' into another terminal window.
Press ctrl + v to 'Paste' into a normal GUI application program, for example Firefox or Gedit.
Have you tried using Ctrl+Ins and Shift+Ins? I'm not sure about copying, but pasting works fine for me. Give it a try and EDIT your question if it doesn't work.
FWIW, I don't do much cutting & pasting in a terminal. Just typing. What are you up to that makes cutting important?
Copy/paste is provided by the terminal program, if at all. There is no general answer. Since you don't tell us which terminal emulator you use, we cannot help. If terminal has pull down menu (gnome terminal), you may get hints. I am almost sure there is no Ctrl+V in xterm or rxvt.
ALSO can get cut/paste from program you are running in terminal. Launch
emacs
in a terminal, cut is Ctrl+W and paste is Ctrl+Y.The only general paste feature will come from the basic Linux OS. This works in a Virtual Terminal (Alt+Ctrl+F1) as well. Use the left button to highlight. Then middle click to paste. Action must happen with no clicks between. Middle click is a focus and paste in one step. I use that all the time.
Also possible to install a clipboard imitation, maybe find terminal to cooperate with it. Transfer text from one program to another.
The one settings that was disabled on my machine preventing middle click paste to work as usual:
org.gnome.desktop.interface.gtk-enable-primary-paste
You can edit this value either by using dconf-editor (UI) or by using the cli:
I think this can only be a placebo for all of those who do not get further even after looking at all of the commands of the answers.
I opened a test file in vim:
Then I pasted with all of the methods I know (and mentioned above). In
i
mode, I pasted from system clipboard with middle-mouse andshift-insert
, which worked. Inv
mode, I also used"*p
for the same thing which got cut slightly. And I tried some other registers:"1y
, then"1p
, same with 2. When Iq!
the file, I could useCtrl+Shift+v
again in the shell.Again, this is not a solution since it would mean that there was a clipboard or a register of a clipboard that was unavailable for some reason - not likely. Much more likely is a mistake on my side.