LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 12-18-2018, 05:08 AM   #1
Gautam4k
LQ Newbie
 
Registered: Dec 2018
Posts: 2

Rep: Reputation: Disabled
How to copy entire contents of UNIX file from putty vi editor and then paste it to Notepad++?


Hi,

How to copy entire contents of file from putty vi editor and then paste it to Notepad++? The file is in UNIX server.
For e.g if there is a xml file with 10KB i get only portion of it in the putty vi editor screen because of which by using mouse i am unable to copy the whole file. Is there a way to copy the whole contents of the file and then paste it to notepad++?

Thanks and Regards
Gautam
 
Old 12-18-2018, 05:12 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I think you can copy the file with putty. from the other hand you can use vim instead of vi and you can use ggVG to select all.
 
Old 12-18-2018, 05:56 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Gautam4k View Post
Hi,

How to copy entire contents of file from putty vi editor and then paste it to Notepad++? The file is in UNIX server.
For e.g if there is a xml file with 10KB i get only portion of it in the putty vi editor screen because of which by using mouse i am unable to copy the whole file. Is there a way to copy the whole contents of the file and then paste it to notepad++?

Thanks and Regards
Gautam
Instead of vi, use cat to dump out the entire file. Then copy the lines in Putty and paste them to your Windows program.

If the file is too long, you need to right-click the upper frame of Putty, select Change Settings in the menu that appears, then select Window. You will find a field labeled with Lines of scrollback. Increase the number.
 
Old 12-18-2018, 06:43 AM   #4
Gautam4k
LQ Newbie
 
Registered: Dec 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks berndbausch ! This works.
 
Old 12-18-2018, 02:50 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Another way:
Use WinSCP to open the file in Notepad++ to begin with.
 
Old 12-18-2018, 03:10 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if you can open a file in vi then why not just copy the file itself, or open it , if it is going over a wire, then save it in to the local directory as a flat file, which it should be. Then open in a different text editor?
 
Old 12-18-2018, 04:10 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by BW-userx View Post
if you can open a file in vi then why not just copy the file itself, or open it , if it is going over a wire, then save it in to the local directory as a flat file, which it should be. Then open in a different text editor?
A very valid point.

I don’t know Gautam4k’s situation, but I often work in a specific environment that gives me remote desktop access, but no other type of connections, i.e. no SSH. I have even copied binaries by ASCII-encoding them and transferring them in the described 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
does Wine Notepad share Windows Notepad's limitations? newbiesforever Linux - Software 17 03-04-2018 10:15 PM
[SOLVED] Preventing the screen copy and paste error on first paste slackartist Slackware 0 04-03-2016 06:48 PM
VNC Client copy/paste to WINDOWS notepad indius Linux - General 4 06-29-2015 10:34 PM
how to delete entire contents of file using vi editor once sunlinux Linux - General 1 08-17-2007 05:48 AM
How can we copy the program code wriiten in notepad to linux vi editor? mayank027 Linux - General 2 10-25-2005 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:32 AM.

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