Copy and Paste in Terminal Programs

Story: The Linux Command Shell For Beginners: Fear Not The Command Line!Total Replies: 7
Author Content
Sander_Marechal

Dec 22, 2008
8:32 PM EDT
From the article:

Quoting:If you're used to using Ctrl-C and Ctrl-V to copy and paste, you may find yourself frustrated in a terminal program... So don't forget that you can use the other Linux Copy-and-Paste method: just highlight what you want with the mouse, then middle-click in your terminal window.


But that involves the mouse. Eeeuuw. Luckily most (all? probably not) terminals know Ctrl+Shift+C and Ctrl+Shift+V for copy/pasting.
herzeleid

Dec 22, 2008
9:19 PM EDT
> But that involves the mouse. Eeeuuw.

I'm been a happy unix/X windows user since the early 90s. I love the unix copy/paste mechanism. left button to copy, middle button to paste. So much nicer than the arcane key stroke sequence or menu navigation required to do it peecee style.

How could you not prefer the unix way?
Sander_Marechal

Dec 23, 2008
3:41 AM EDT
Because you can't replace a selection that way.

Select text. Ctrl+C to copy. Select different text. Ctrl+V to replace the selection with the text you copied earlier. You can't do that with middle-click. Also, sometimes I accidentally drag my mouse a bit when clicking. That makes a new selection and destroys the old one. Now middle-click won't work.

Actually I like vim's controls even better. Copy (yank) with y and paste with p. It's too bad that I can't use it everywhere. I'd love to have the power of vim available in firefox (textareas), OpenOffice.org or even just the bash terminal. I often find myself pressing Shift+V to select an entire line of text, only to see a capital V appearing.
tuxchick

Dec 23, 2008
10:59 AM EDT
How do you select text without using the mouse?
Sander_Marechal

Dec 23, 2008
11:27 AM EDT
Shift+arrows/Home/End/PgUp/PgDown.
ColonelPanik

Dec 23, 2008
1:51 PM EDT
Sander, if you can remember > Shift+arrows/Home/End/PgUp/PgDown < You may be a Geek.

And this just consigned the Colonel to lowly user status for evar.

Sander_Marechal

Dec 23, 2008
2:28 PM EDT
@Colonel: It's not all strung together. Just hold shift and move the cursor (arrows, home, end, pgup and pgdown all move the cursor).
herzeleid

Dec 23, 2008
3:38 PM EDT
> How do you select text without using the mouse?

Actually I'd spend the $9 and get a mouse.

Seriously, if I'm accessing a headless server via an ssh session in a konsole, xterm or gnome terminal session, then I use the logitech gaming mouse I already have on my workstation.

If I'm working on location on a mouseless server somewhere, I'm probably not going to be doing a lot of copy/paste anyway. If anything, I'll make use of awk, sed, grep, emacs command line editing and file redirection, and clean it all up with vi.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!