LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-17-2013, 06:37 AM   #1
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Rep: Reputation: Disabled
how to copy commands output in places without mouse ?


Hi
How to copy output of commands in environment that there is no mouse to highlight and copy part of the text? like vmware console or when we stuck in grub rescue .
sorry i asked it mistakenly here instead of asking it in newbie .

Last edited by ali.abry; 02-17-2013 at 07:30 AM.
 
Old 02-17-2013, 10:18 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
usually you can use the command tee to store the output of any command (in a file) and you can use/copy that result:
<your command> | tee <filename>
 
Old 02-17-2013, 10:44 AM   #3
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Original Poster
Rep: Reputation: Disabled
thanks for reply.
if i do that then i can open it with vi to copy part of text.
is there any command in vi that i can specify exact part of the text by high lighting to copy only the high lighted part?
i now the `y` option but i should specify number of character for it .i looking for easier way.
 
Old 02-17-2013, 11:07 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
where do you want to copy to? vi does not handle external clipboard.
 
Old 02-17-2013, 11:30 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
ssh to the guest and you'll have commands "output" available to your local clipboard.
 
Old 02-17-2013, 12:12 PM   #6
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
where do you want to copy to? vi does not handle external clipboard.
think that I'm going to take uuid from blkid command and use it in fstab . how can i copy the desired uuid ?
i aware of ssh but think that its not available .
 
Old 02-17-2013, 12:56 PM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,901

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
in case you need that uuid on the same host you can save the output of blkid in a file, open this file and fstab in vi and you can use y (yank) and p (put) to copy lines between files and you can use :e# to switch between files.
 
Old 02-17-2013, 02:34 PM   #8
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
For stuff like bootloader messages or kernel panics on real hardware, I use a camera. It also works for BIOS errors.

Same stuff on a virtual machine console can usually be done with a screen capture on the involved window.

Where a Unix-like system is running and there is hope of recovering the files afterwards, the script command is an alternative. If the files might not be savable on remote, run script locally if you can reconnect.
 
Old 02-17-2013, 07:24 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Quote:
think that I'm going to take uuid from blkid command and use it in fstab
Basic steps:

1. run blkid and output to a temp file, optionally using awk, cut whatever to get uuid
2. vi temp file and tidy it up so it has ONLY the string you want & save it
3. edit fstab, move cursor to point of insertion, then
Code:
:r /path/to/temp.txt
r = read ; reads specified file and dumps content at current cursor position.



Unlike yank/put, doesn't require you to count lines, and text is stored in temp file on disk in case you need to redo. Any size/amt of text can be in temp file.
 
Old 02-18-2013, 12:42 AM   #10
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Original Poster
Rep: Reputation: Disabled
thanks every one.
I think its solved by now .
the vi way looks like the easiest way.
 
  


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
[SOLVED] Linux Ubuntu - Places - Network Places Bookmarks question ejspeiro Linux - Networking 1 04-19-2011 10:50 AM
copy history commands ZAMO Linux - General 4 01-04-2008 01:30 PM
What copy commands does Linux have? IonMarais Linux - Newbie 4 10-26-2006 02:40 AM
Redirect output to multiple places granny Linux - Newbie 1 02-12-2004 12:31 PM
Appropriate places for startup commands? bluefire Linux - General 3 10-07-2003 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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