LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-13-2008, 05:28 PM   #1
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Rep: Reputation: 30
Copying and paste to file with gpm


Is it possible to use the general purpose mouse in a terminal
or console to copy and paste to a file?

Copy/paste with gpm seems only to work to paste in the terminal.

I would like to be able to copy terminal output, such as an error
message (one tha does not make it to any log), and paste it into
a file or some other permanent retention.
 
Old 07-14-2008, 01:45 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Yes, you can copy/paste into a fie using gpm. Highlight the text you want using the left mouse button and then open an editor and paste, using wither the middle button (or wheel) or both buttons (if it's a 2 button mouse) and save the file.
But you cal always redirect logs or the output of a program into a file using the ">"
 
Old 07-14-2008, 09:49 AM   #3
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
Which editor? I tried Midnight Commander, but that only has copy and move commands
for the current file loaded into its editor. I also cannot use any of the editors
in KDE: seems these use their own separate clipboard and paste something other than
what gpm stored, which I guess is not surprising.

Again which editor: vi, joe, emacs?

How might I use ">" or "<" to redirect the right mouse button output in the console?
 
Old 07-14-2008, 09:59 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can use vi (in edit mode if you want to paste), joe, nano (pico) etc.
If you want to redirect logs or the output of a program you can use ">" to put it in a file:
Code:
cat logifile.log > myfile
./some-program > myfile
 
Old 07-14-2008, 10:15 AM   #5
Absolute_P
LQ Newbie
 
Registered: Nov 2004
Location: Land of the penguine's or maybe south london
Distribution: Gentoo 2008.0 (2.6.24)on Laptop Gentoo 2008.0 (2.6.25)
Posts: 16

Rep: Reputation: 0
not sure what i would do is hold shift and left mouse button to highlight, then use nano -w /path/to/file once in the file (if it does not exist nano will create it) hit the middle mouse button to paste ctrl-x to save.

now if you use ctrl + alt F1/F2 etc.. to go to another console you will be reading from the same clipboard unless that console is running X then you will be reading from X/gnome/kde's clipboard etc.. also leaving any console will chop of anything on screen so you can no longer scroll up. but basicaly, if you want to copy and paste from a console not running X nano should work, it has no gui so X is not needed.
sorry if im talking about the wrong thing.
 
  


Reply



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
how to paste the content of 2 files onto 1 line (in a file)? PatrickBecks Programming 2 02-14-2008 06:41 AM
Copy Text File and Paste to /hdd CD-RW aquatux SUSE / openSUSE 3 12-29-2006 06:32 AM
please help with cut and paste into .c file henry_huckem Programming 7 01-28-2005 05:37 AM
can copy-paste or create new file/folder, if boot from live cd gjo Linux - Distributions 3 09-17-2004 08:43 AM
How do you copy and paste a file from a command prompt? thenewguy05 Linux - Newbie 6 07-13-2004 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration