Ubuntu – Copy and Paste to/from Ubuntu shell in Windows 10

command linewindows-subsystem-for-linux

I just got a new laptop with Windows 10 and installed Ubuntu. In the past, I used Cygwin and/or VMware with RHEL 7.6 for Linux.

Using Ubuntu shell, I know how to enable Cntl-Shift C/V to do copy/paste. But using Cygwin or VMware with RHEL 7.6, I could also use my mouse to do copy/paste. I cannot get this to work with the Ubuntu shell. Is there something I must do to enable it like I did for Cntl-Shift C/V to work?

For example, if I do ls -l in a directory and use my mouse to highlight, for example, a file named this_is_a_long_file_name.txt with my mouse, I could type "cat " and then right click and it would paste the high-lighted item for me.

Is there some way to get that to work?

Best Answer

Within WSL the right mouse button is copy when there is a selected text, and the same button is paste when there is something in the clipboard, no mater it is copied within the WSL window or within another Windows application.

So if you want to copy some text from the terminal window (e.g. some file name) and paste it onto the command line you need to select the text by holding the left mouse button, and the double cluck with the right mouse button for copy and paste.