LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy-paste in the shell (https://www.linuxquestions.org/questions/linux-newbie-8/copy-paste-in-the-shell-567472/)

fuzzyBuzz 07-07-2007 05:53 PM

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 ...)?

saikee 07-07-2007 06:21 PM

You can highlight text in a terminal and the right click it to select copy. The text can be pasted anywhere later on.

pixellany 07-07-2007 07:22 PM

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.

izquierdista 07-08-2007 01:43 AM

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.

fuzzyBuzz 07-08-2007 02:41 AM

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.

Nylex 07-08-2007 02:44 AM

Click your wheel button.

Wim Sturkenboom 07-08-2007 04:16 AM

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).

saikee 07-08-2007 07:20 AM

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.

Wim Sturkenboom 07-08-2007 09:14 AM

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 :)

saikee 07-08-2007 10:18 AM

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?

Wim Sturkenboom 07-08-2007 12:47 PM

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.

saikee 07-08-2007 01:12 PM

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.


All times are GMT -5. The time now is 09:12 PM.