LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-07-2007, 05:53 PM   #1
fuzzyBuzz
Member
 
Registered: Sep 2005
Posts: 34

Rep: Reputation: 15
Copy-paste in the shell


Is there a way to configure the shell window to copy-paste selected text to the clipboard using the mouse buttons or keyboard shortcuts?
Is there a difference if i am running KDE/Gnome or the type of shell (sh, tsh, csh ...)?
 
Old 07-07-2007, 06:21 PM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
You can highlight text in a terminal and the right click it to select copy. The text can be pasted anywhere later on.
 
Old 07-07-2007, 07:22 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I think that the normal ctrl-X,C,V routine is not used in the shell terminals because it would conflict with some bash and/or editor commands.

As a side note, I have found that "right-click" is more often than not a real power tool. I have learned to try it before anything else.
 
Old 07-08-2007, 01:43 AM   #4
izquierdista
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 342

Rep: Reputation: 30
Yeah that is true, you highlight the text and right click,

there is also another way as well, lets say you closed the shell and then came back the next day opened up the shell and didnt remember what you typed. All you have to do is press the up or down key and you will see the different lines of code that you have ever put on there. Obviously the things from the day before will be first etc.

then once you see the line of text that you want just left click and it will be typed on there for you.

you can also use this method whenever you want to run a command many times and dont want to waste your time cutting and pasting.
 
Old 07-08-2007, 02:41 AM   #5
fuzzyBuzz
Member
 
Registered: Sep 2005
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee
You can highlight text in a terminal and the right click it to select copy. The text can be pasted anywhere later on.
But isn't there a faster way to copy paste without having to go through a menu? In Windows you can select text then copy it using right click. Then, the next right click will paste the text. Surely Linux has a similar trick.
 
Old 07-08-2007, 02:44 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Click your wheel button.
 
Old 07-08-2007, 04:16 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by zvirack
In Windows you can select text then copy it using right click. Then, the next right click will paste the text.
Certainly not the way I want it; if I right click, I expect the context menu. And I've never seen it, but I'm not a windows specialist.
[edit]
After reading post #8, I think that you probably were refering to the dos-prompt. So consider above comment as not written.
[/edit]


It might depend on the graphical environment that you're using, but in Ubuntu (Gnome) and Xubuntu (XFCE), <ctrl><shift>C and <ctrl><shift>V are the shortcuts for copying and pasting in a terminal (check the menus).

Last edited by Wim Sturkenboom; 07-08-2007 at 09:18 AM.
 
Old 07-08-2007, 07:20 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
zvirack,

I am not here to defend Linux but on a level playing field the equivalent shell in Windows is the command prompt.

you can't even use the mouse there, let alone copy and paste!

If you want to enjoy the ease and facilities available in a graphic desktop you don't go into a shell to get them!

These direction keys and mouse right right clicking business are the common standard with which you can survive from operating system to operating system. If you don't like it then you are better off sticking with the system that gives you the ease you want.

If you think life is tough in a bash shell you should try the csh, tcsh or ksh shell for a change.

Last edited by saikee; 07-08-2007 at 07:28 AM.
 
Old 07-08-2007, 09:14 AM   #9
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by saikee
I am not here to defend Linux but on a level playing field the equivalent shell in Windows is the command prompt.

you can't even use the mouse there, let alone copy and paste!
When last did you use Windows
 
Old 07-08-2007, 10:18 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Wim Sturkenboom,

Same time I wrote the reply. I run a XP on another PC to check it out for sure.

I can close the command prompt box with a mouse but not highlighting the text to do copy+paste. You can copy things outside and paste in the command prompt but not take anything out apparently.

I later checked with Vista. Same applies.

You seem to think otherwise. What version of Windows are you using?

Last edited by saikee; 07-08-2007 at 10:29 AM.
 
Old 07-08-2007, 12:47 PM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
You can. From the 'menu' (<alt><space>) -> edit -> mark. Highlight with mouse and press <enter> to copy to clipboard.

Verified on old W98SE machine how it had to be done exactly. Works in Win2K (for sure) and WinXP (why not) as well; both not at hand.

Last edited by Wim Sturkenboom; 07-08-2007 at 12:55 PM.
 
Old 07-08-2007, 01:12 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Wim Sturkenboom,

Yes you are right. It is hidden inside the top left icon in Vista.

The mouse can be used to mark and paste text in MS Windows command prompt.

It works in graphic border as well because one can copy one character wide vertical column in the display whereas in a bash shell the full line horizontally is always copied

Learn a new thing today.

Last edited by saikee; 07-08-2007 at 01:17 PM.
 
  


Reply

Tags
shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell type vs copy paste gr00ve Linux - General 8 03-31-2006 02:38 PM
What is with copy and paste? General General 16 12-23-2005 06:37 PM
how to copy and paste acd copy cd paschim Linux - General 2 04-05-2004 09:25 AM
Copy Paste in shell Zolan Linux - Newbie 1 03-29-2004 10:41 AM
Copy and Paste? cli_man Linux - General 11 05-16-2003 04:09 PM


All times are GMT -5. The time now is 03:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration