LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy lines from console (https://www.linuxquestions.org/questions/linux-newbie-8/copy-lines-from-console-684019/)

saidul 11-17-2008 06:21 AM

Copy lines from console
 
Hi everyone,

I am trying to copy some lines from my console, but i was unable to do it.
Anyone please tell me how to copy lines from console.
Actually i ran a program it shows some error. I want to copy this error from console and paste it into other place.

is there anyone knows it , please help me.

saidul

dive 11-17-2008 06:35 AM

Which sort of terminal?

In X with konsole/terminal/xterm etc you usually just select the text with mouse and use right click to paste.

You can also redirect the output into a file:

<command> > error.log

Then all output will go into error.log. Use 2> error.log for only errors.

joe f. 11-17-2008 06:55 AM

You don't mention which distro you're using, but whichever it is, see if it comes with gpm. I use Slackware and it comes with GPM. What I do inside X or not is position my cursor where I want the text to go, highlight the text I want to copy, then click the middle mouse button where the cursor is.

i92guboj 11-17-2008 07:53 AM

Besides gpm and redirection, another option is to use screen, which amongst many useful things, can be used to copy and paste text as well, only inside the same screen session though, so it will not help you if you want to paste from a terminal into an X based text editor.

arizonagroovejet 11-17-2008 01:43 PM

If you're using Konsole in KDE then highlight the text and then select 'Copy' from the Edit menu.

In KDE 4 you can also highlight then right click and select 'copy', maybe you can in KDE 3 too but I can't remember and don't have it to hand to try.

trickykid 11-17-2008 02:54 PM

Run the program again and output it to a file.

./command-that-fails > output.log

arizonagroovejet 11-17-2008 03:01 PM

Quote:

Originally Posted by trickykid (Post 3345316)
Run the program again and output it to a file.

./command-that-fails > output.log

Error messages probably got to stderr though...

Code:

./command-that-fails &> output.log

trickykid 11-17-2008 03:04 PM

Quote:

Originally Posted by arizonagroovejet (Post 3345326)
Error messages probably got to stderr though...

Code:

./command-that-fails &> output.log

Ah true, I'm sleepy.. half ass answers still count don't they? ;)

dasy2k1 11-17-2008 03:16 PM

try highlighting the text and pressing
^insert

use shift+insert to paste


All times are GMT -5. The time now is 04:34 AM.