ghacks Technology News

Get To Know Linux: Copy and Paste

It may sound like we’ve stepped back to Computers 101, but copy and pasting in Linux can sometimes be a bit different than it is in either Windows or Mac. The good news is that it is most often far easier to copy and paste in Linux than it is in any other operating system. How can such a basic function be any easier? Read on to find out.

The typical action of cutting and pasting does and should (in most cases) work across applications as well as into the command line. The trick is knowing either the key combinations or the correct mouse buttons. So whether your copying and pasting from one document to another, from document to email (or vice versa), or just about any application to any application Linux can copy and paste. Let’s find out just how.

The Mouse

This is the big one that makes your copy/paste life very simple. With the Linux operating system there are three mouse buttons: 1, 2, 3. The left mouse button is button 1, the right mouse button is button 2, and the mouse wheel is button 3. If your mouse doesn’t have a mouse wheel then pressing both 1 and 2 together is the equivalent of button 3. Now that we have that out of the way I am going to show you a nice trick. Go to a document (OpenOffice, Abiword, or even compose an email). Highlight some text by clicking button 1 and dragging the mouse over the text you want to highlight (simple text selection). Once you have selected your text click your cursor in a blank area of the document and click button 3. What you should see is the selected text is pasted where you clicked with button 3. So the action of highlighting text with button 1 is copying and clicking with button 3 is pasting. How simple is that? This action also works from document to command line and vice versa.

The Keyboard

Naturally the standard keyboard key combinations will work for copying and pasting. There are a couple of exceptions. When copying within (or to and from) some terminal windows there are different key combinations to use. For example, in gnome-terminal instead of Ctrl-c and Ctrl-v (for copy and paste) you use Ctrl-shift-c and Ctrl-shift-v for copying and pasting. This can be changed within the profile editor in gnome-terminal (if you want this feature to echo the standard combination.) Be aware, however, that if you copy text by selecting via the left mouse you can not paste by using Ctrl-v. The Ctrl-v combination (or Ctrl-Shift-v combination) only works in conjunction with the Ctrl-c or Ctrl-Shift-c combinations.

The Menu

As you can imagine nearly every Linux GUI application has an Edit menu that includes the Copy/Paste entries. These work exactly as you would expect. These menu entries also work in conjunction with the Ctrl-c/v combinations, but not the button 1 highlight action (button 1 copy action only works with the button 3 paste action).

Final Thoughts

I will warn you that once you get used to the button1/3 copy/paste action you will find yourself attempting it in all other operating systems. This method of copy/paste is the easiest means of copying and pasting content bar none. It is nice, however, that the various Linux distributions include other means for those users who prefer the standard methods.

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook or Twitter.

Related Articles:

Copy Paste
Copy Paste with middle mouse button
Paste And Go Firefox Add-on To Speed Up Copy Paste Load Operations
Firefox Extended Copy
Paste And Go Firefox Extension



About the Author:

Author: , Tuesday March 3, 2009 -
Tags:, , , , , ,


Responses so far:

  1. > Be aware, however, that if you copy text by selecting via the
    > left mouse you can not paste by using Ctrl-v.

    In KDE the user can copy with the mouse and paste with the keyboard shortcuts. That is probably a Gnome bug. Did you search to see if there is a bug report open?

  2. jack says:

    What is KDE: I don’t believe it’s a bug. and the mouse-to-keyboard doesn’t work (at least in my installations) for either GNOME 2.24 or KDE 4.2. nor does it work in E17, E16, AfterStep, Windomaker, or Fluxbox.

  3. Sigh says:

    So how do you replace a selection of text with another selection of text?

    Oh I see, Linux can’t do that.

  4. tarlok says:

    thnks man gd work..

  5. Luigi says:

    Thank you that’s interesting but I have the following problem:

    When I want to replace a text (eg: address in browser) usually I do the following:

    1select a text,
    2 press Ctrl+C
    3 select text to be replaced
    4 press Ctrl-V

    If I do that with MOUSE, when I select the text to be replaced it goes into the clipboard making uneffective the next pasting

    How could I avoid that?

    Thanks

  6. Pedro says:

    “Once you have selected your text click your cursor in a blank area of the document and click button 3. What you should see is the selected text is pasted ___where you clicked with button 3___.”

    This may seem trivial, but I have a problem with this. How can I paste the selected text on the destination window where the previous cursor was, instead of where the mouse actually points?

    Reason: With the current way, I must be very careful to point to the place where the text will appear. If it worked as I describe, I would only have to click anywhere in the receiving window, and know that the text will always appear in the place where the cursor is.

    Thanks!

  7. Bill says:

    Thank you for the clear explanation. If only I had read this a year ago! Pedro’s comment is also enlightening.

  8. Steve says:

    You can also copy and paste in Linux using ctrl+insert to copy, and shift+insert to paste. If you find your edition of Linux doesn’t support the Windows ctrl+x/c/v convention, try those instead.
    ctrl/shift+Insert also works separately from the highlight/click method, so if you want to highlight and replace text, you can use that method too.

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us