LinuxQuestions.org
Visit Jeremy's Blog.
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 11-17-2008, 06:21 AM   #1
saidul
LQ Newbie
 
Registered: Nov 2007
Posts: 12

Rep: Reputation: 0
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
 
Old 11-17-2008, 06:35 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
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.
 
Old 11-17-2008, 06:55 AM   #3
joe f.
LQ Newbie
 
Registered: Jan 2006
Location: Maryland, USA
Distribution: Slackware & Arch (at the moment)
Posts: 15

Rep: Reputation: 1
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.
 
Old 11-17-2008, 07:53 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
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.
 
Old 11-17-2008, 01:43 PM   #5
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,024

Rep: Reputation: 173Reputation: 173
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.
 
Old 11-17-2008, 02:54 PM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Run the program again and output it to a file.

./command-that-fails > output.log
 
Old 11-17-2008, 03:01 PM   #7
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,024

Rep: Reputation: 173Reputation: 173
Quote:
Originally Posted by trickykid View Post
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
 
Old 11-17-2008, 03:04 PM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by arizonagroovejet View Post
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?
 
Old 11-17-2008, 03:16 PM   #9
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
try highlighting the text and pressing
^insert

use shift+insert to paste
 
  


Reply

Tags
console, copy, from


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
Console gives dashes instead of lines rob207 Linux - General 1 10-14-2006 10:30 AM
copy lines in vi editor jkmartha Linux - Newbie 4 05-14-2005 02:19 AM
console is about 8 lines below screen ... kthiessen Linux - Laptop and Netbook 0 02-24-2005 08:06 PM
shell script to copy lines from a file Warmduvet Programming 2 09-14-2004 09:25 PM
Console buffered lines jedi_it Linux - Software 0 05-19-2004 02:48 AM


All times are GMT -5. The time now is 11:02 PM.

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