Copy and Paste
While most applications support the mechanism for cut, copy & paste that most people are used to from other operating-systems, X11 also has another mechanism which is faster once you get used to it. It even works between two linux/unix-computers across the network
Picking the menus
As you know from other operating-systems, you can pick the items “cut”, “copy”, and “paste” from the “edit” menu. Works as expected.
Keyboard shortcuts
Standard
As you know from other operating-systems, you can cut, copy and paste by pressing the control-key together with “x”, “c”, “v”. The X is nice to remember for to cut. The C is for copy, and the V looks like the insertion mark we used in school when we forgot a letter in the middle of a word. Works as expected
New and fun maybe
There are also some keyboard shortcuts you can use that are a little different. These belong to some of the Linux editors you might use without a mouse. That’s enough to go on another page Copy and Paste with no mouse in console editor
X11-Goodie: Mouse only!
In X11, selecting a text with the mouse is enough to put it into the X11-clipboard. You can insert it by pressing the middle mouse button. If your mouse has a wheel, this is the button you need to press. If your mouse has only two buttons, X11 is usually configured to use a simultaneous click on both of them instead.
This can be really fast. For example, I have configured my browser to start without a page loaded, the URL-field is already empty. So I can use this fast method to copy URLs into the browser.
From one box to another
So, you have more than one computer connected. You can use the technique described above to copy text from one Linux-PC to another.
You connect to the other box using
ssh -X user@computer
where user is the username you need to log in, and computer is the ip-address of the computer you want to log into.
After giving your password, any command you type in that shell runs on the other computer but displays output and windows on your screen. And then you can copy to and from. Works like expected :)
Can you give me an example, please?
Sure, glad you asked.
I have a workstaion called “vivid” configured so that two nfs-exports from the server (called “files”) are mounted. Also, a removable drive can be used. All this information is inside /etc/fstab. For my laptop, I want to have the same lines, so I can have the same environment. I do this by a simple copy and paste operation across the network:
- I log into the the other computer using ssh. For the screenshot I used
ssh -X root@192.168.1.191
but as I realize now, I could have done it as user.
- I display the text I am interested in. While I could have done so using “cat” or “less”, I chose “emacs”. Emacs displays the hostname in the window-title, so you can see where you are.
emacs /etc/fstab
- I selected the lines I want to reuse by moving the mouse over them while pressing the left mouse-button. It gets highlighted.
- In another shell, I start emacs locally. I chose some example-filename, but in real life, I would have taken /etc/fstab directly.
- Inside the local emacs-window, I push the middle mouse-button. The text gets inserted.
- After finishing my remote-work, I can log out by typing “exit”, “logout”, or simply by pressing ctrl-D
Do you have a screenshot of that example?
Only when using X11?
No. There is a piece of software called ‘gpm’ which enables the technique described above also for the plain linux text-console. It even works across different virtual terminals which can be switched using <alt>+<f1> … <alt>+<f6>. Again, you can log into different computers on different virtual consoles to copy & paste across the network.
We also have compiled a list of ways to copy and paste in different text-mode-editors on this page.
How can I learn more about the wonderful world of networking?
Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan