LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-15-2010, 01:13 PM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
copy/paste output from shell (not terminal)


Hi. I often have issues starting my window manager--xfce. My computer misbehaves in one of 3 ways, one of which is to fail to open X, but generate several screens of info. I want to paste that info to this site, but since I'm in the shell, not the terminal (please correct my vocabulary if it's wrong here), I don't know how to copy and paste the output, since right-clicking doesn't give me a menu. Even if I could copy I'm not sure the information would be accessible in X. Are there any other options?
 
Old 07-15-2010, 01:15 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
If you have gpm installed or running, you can use your mouse to copy and paste text in a terminal.

It would be the same as highlighting the text, then opening an editor on the command line to paste, like vi newfile to save the pasted text in the file.
 
1 members found this post helpful.
Old 07-16-2010, 01:44 AM   #3
alan99
Member
 
Registered: Mar 2010
Distribution: Debian
Posts: 175

Rep: Reputation: 31
Quote:
Originally Posted by trickykid View Post
If you have gpm installed or running, you can use your mouse to copy and paste text in a terminal.

It would be the same as highlighting the text, then opening an editor on the command line to paste, like vi newfile to save the pasted text in the file.
You weren't listening. He said he was having problems and had no window manager and thus no graphic terminal, just a console. I don't know if there is anything for slackware, but in debian there is a package called gpm (general purpose mouse) which lets you do some limited cut and paste within your console, but it might be awkward to do it. Maybe you could cut and paste a line at a time into a command line

echo ' <place cursor here and right click after selecting the line> ' >> filename

this might allow you to copy the error messages to a test file and then if you could figure out a way to get that file copied into a post on the forum I guess that might do what you want.
 
Old 07-16-2010, 01:48 AM   #4
alan99
Member
 
Registered: Mar 2010
Distribution: Debian
Posts: 175

Rep: Reputation: 31
Or, you could check to see if your system is logging any error messages when it boots. This would probably be in /var/log/
 
Old 07-16-2010, 07:15 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Redirect both output and error messages to a file:

Code:
command &> file
 
Old 07-16-2010, 07:49 AM   #6
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 91
@alan99
Quote:
You weren't listening. He said he was having problems and had no window manager and thus no graphic terminal, just a console. I don't know if there is anything for slackware, but in debian there is a package called gpm (general purpose mouse) which lets you do some limited cut and paste within your console, but it might be awkward to do it. Maybe you could cut and paste a line at a time into a command line

echo ' <place cursor here and right click after selecting the line> ' >> filename

this might allow you to copy the error messages to a test file and then if you could figure out a way to get that file copied into a post on the forum I guess that might do what you want.
No you were not reading properly. Read trickykid's post properly and you'll see that the same solution as yours is being suggested with no mention of the GUI.
 
Old 07-16-2010, 09:51 AM   #7
alan99
Member
 
Registered: Mar 2010
Distribution: Debian
Posts: 175

Rep: Reputation: 31
Quote:
Originally Posted by alli_yas View Post
@alan99


No you were not reading properly. Read trickykid's post properly and you'll see that the same solution as yours is being suggested with no mention of the GUI.
What do you mean I wasn't reading properly? It seems trickykid was not reading properly. The original poster said he was using xfce as a window manager, Not gnome (gdm), so please don't tell me I am "reading it wrong". As for the solution 'similar' to mine, since the messages are being generated at startup the only way for that redirect to work is in you put that somewhere in one of the startup scripts so that the redirect happens before the error messages and not after.
 
Old 07-16-2010, 09:57 AM   #8
alan99
Member
 
Registered: Mar 2010
Distribution: Debian
Posts: 175

Rep: Reputation: 31
sorry, I guess I was reading wrong I thought He said gdm not gpm
 
Old 07-16-2010, 10:00 AM   #9
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 91
Quote:
sorry, I guess I was reading wrong I thought He said gdm not gpm
No problem We all scan read stuff sometimes
 
Old 07-16-2010, 10:56 AM   #10
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by alan99 View Post
sorry, I guess I was reading wrong I thought He said gdm not gpm
The great trickykid is never wrong.. except when I should have referred to terminal as console in my original reply.
 
Old 07-16-2010, 11:12 AM   #11
zagzagel
Member
 
Registered: Jul 2010
Location: Portugal
Distribution: Arch Linux
Posts: 31

Rep: Reputation: 1
Although I agree redirection is the best choice, another possibility might be GNU Screen.
 
Old 07-16-2010, 11:14 AM   #12
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by MTK358 View Post
Redirect both output and error messages to a file:

Code:
command &> file
This isn't helpful when it's a message not invoked by a command you might have run yourself, perhaps a system message or error during bootup process, etc.
 
Old 07-21-2010, 10:43 AM   #13
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Thank you all for your help. When the problem finally recurred I ended up following trickykid's advice in his first post: I selected the text, wrote to a file in parts using the gpm feature, and now I can post the information.
 
Old 07-21-2010, 01:37 PM   #14
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,040
Blog Entries: 1

Rep: Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366Reputation: 1366
Hi,

I'm late but wish to add the mouse buttons for 'gpm' usage. The middle button will insert the highlighted text at the cursor position on current line. Don't forget the pick by double-click to highlight then either copy, paste or insert from point. If setup properly you can use 'gpm' on console(s), terminals or GUI. Handy whenever you want to mix the cli with other apps. Great with 'vi'.

 
  


Reply


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
[SOLVED] Can't copy-paste from one terminal to another using vim cola Slackware 11 12-18-2009 10:51 PM
copy and paste in a terminal? BmxFace Linux - General 5 06-29-2003 05:08 AM
copy and paste in terminal bash Linux - Software 3 07-08-2002 08:11 PM
Copy & Paste to Terminal monowar Linux - Newbie 1 07-02-2002 11:22 AM
copy/paste in a terminal session aethereal Linux - Newbie 4 12-19-2001 03:48 AM


All times are GMT -5. The time now is 02:41 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