LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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



Closed Thread
 
Search this Thread
Old 06-07-2010, 04:32 PM   #1
Idiosyncra3y
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
Exclamation Copy text files from linux to windows


Hi

I am running some Pcap files through editcap and then tshark. I am running fedora 11. This will create a couple of thousand text files all numbered sequencially 1-x. How can I copy these files across a network(I connect using putty) or how can I copy them onto an external HD so that when I view them on the windows machine they have the right formatting (Windows know to open them with wordpad/notepad) basically that windows knows that they are text?
edit: The linux machine has ext 4 HD's, the windows has NTFS. Would it help if I used an external HD with fat32?
Thanks a lot

Last edited by Idiosyncra3y; 06-07-2010 at 04:37 PM.
 
Old 06-07-2010, 04:48 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
UNIX/Linux use only Line Feed (LF) at end of a line where as Windows/DOS uses LF/CR (Carriage Return). That is a control-M. When you copy DOS text file to UNIX/Linux and vi it you actually see the ^M at the end of each line.

You can convert Linux text to DOS text by running "unix2dos" on the file. You can convert DOS text to Linux text by running "dos2unix".

If you use ftp for the transfer and do it in ASCII mode rather than BINARY mode it actually does the conversion for you. (In BINARY mode it transfers the files "as is").
 
Old 06-07-2010, 04:55 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Set your program to create the files with a .txt extension. That takes care of one problem.
It doesn't matter about the different filesystems if you copy across a network. That's the whole point of protocols - any machine can understand them.

I would suggest using the built-in windows ftp client to log into the linux machine and use mget *.txt to retrieve the files. Change to the correct local directory before starting the ftp client.

This of course assumes you have ftp installed and running on fedora. If not then yum install vsftpd and open the port in the firewall.

Last edited by smoker; 06-07-2010 at 05:05 PM.
 
Old 06-07-2010, 04:59 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
If you use ftp for the transfer and do it in ASCII mode rather than BINARY mode it actually does the conversion for you.
No it doesn't.
 
0 members found this post helpful.
Old 06-07-2010, 06:05 PM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,056

Rep: Reputation: 94
I didn't see anyone recommend winscp. SCP uses ssh to copy files over and is graphical.

You can also create a share one your xp workstation and connect to it using samba.

As for the formatting I don't think I have ever had a problem going from unix formatted files to windows. Only had problems going in reverse because of windows new line formatting.
 
Old 06-08-2010, 05:03 AM   #6
Idiosyncra3y
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you all... A fool I am. The simplest solution is so often the best: Include the .txt extension when I print the files. Didn't know that linux would accept that. Thanks all
 
Old 06-08-2010, 06:40 AM   #7
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Quote:
I didn't see anyone recommend winscp. SCP uses ssh to copy files over and is graphical.
Was just about too WinSCP is a great tool for doing this kind of thing where you're moving files across between Linux/Windows.
 
Old 06-08-2010, 08:06 AM   #8
posixculprit
Member
 
Registered: May 2010
Posts: 136

Rep: Reputation: 42
Quote:
Originally Posted by smoker View Post
No it doesn't.
Yes it does. RFC 959 "File Transfer Protocol", section 3.1.1.1:

Quote:
3.1.1.1. ASCII TYPE

This is the default type and must be accepted by all FTP
implementations. It is intended primarily for the transfer
of text files, except when both hosts would find the EBCDIC
type more convenient.

The sender converts the data from an internal character
representation to the standard 8-bit NVT-ASCII
representation (see the Telnet specification). The receiver
will convert the data from the standard form to his own
internal form.

In accordance with the NVT standard, the <CRLF> sequence
should be used where necessary to denote the end of a line
of text.
TFTP (Trivial File Transfer Protocol) also has such an "ASCII" mode.
 
1 members found this post helpful.
Old 06-08-2010, 11:28 AM   #9
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Quote:
I've been doing this for over a decade. If you don't like my response, ask yourself why I gave it.
I am never difficult just for the sake of it. (unless you insult me)
I do NOT like your response and think you WERE just being difficult because:
1) It is wrong
2) You didn't offer any alternative assistance to the OP.
3) Your signature shows you think you know it all.

I've been doing UNIX full time since 1991 and Linux since 1997 and I'm smart enough to know that I don't know it all yet and likely never will. I'm also fairly certain you do not and never will either.

Last edited by MensaWater; 06-08-2010 at 11:38 AM.
 
Old 06-08-2010, 01:57 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by MensaWater View Post
I do NOT like your response and think you WERE just being difficult because:
1) It is wrong
2) You didn't offer any alternative assistance to the OP.
3) Your signature shows you think you know it all.

I've been doing UNIX full time since 1991 and Linux since 1997 and I'm smart enough to know that I don't know it all yet and likely never will. I'm also fairly certain you do not and never will either.

And your sig gives you the right to knock others
sig in public rather than in an e-Mail? I think not.


Cheers,
Tink
 
Old 06-08-2010, 02:02 PM   #11
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
Originally Posted by MensaWater View Post
I do NOT like your response and think you WERE just being difficult because:
1) It is wrong
2) You didn't offer any alternative assistance to the OP.
3) Your signature shows you think you know it all.

I've been doing UNIX full time since 1991 and Linux since 1997 and I'm smart enough to know that I don't know it all yet and likely never will. I'm also fairly certain you do not and never will either.
Did you read my other response ?

FTP does not convert *nix format to windows format.

It's because of people like you that I have such a signature.

I never make a post without testing it first.
So, go on, vi a document in linux, save it with a .txt extension then ftp get it from a windows machine. Make sure to open it with Notepad.

It has never worked for me on many versions of linux since the late '90s.

So you are now on my ignore list. Happy now ?

Maybe you should try to understand the statements I make in my sig.
They came about because of fools who DID think they knew it all and refused to take advice. At no stage do I claim to "know it all" I merely suggest that my answers may contain the idea that the person needs to use TO WORK IT OUT FOR THEMSELVES instead of expecting a word perfect solution to every little problem they have.

Last edited by smoker; 06-08-2010 at 02:15 PM.
 
Old 06-08-2010, 02:42 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
And since this is derailing I'm closing it. My apologies to the OP.
 
  


Closed Thread


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
How to copy text from vmware from linux text terminal to word document in windows? meandsushil Linux - Newbie 40 01-12-2011 07:06 AM
copy files from Windows to Linux tigertim71 Linux - Newbie 3 01-12-2009 11:56 PM
copy files form Linux to Windows OS zillah General 4 02-02-2006 04:24 PM
copy files from linux dvr to windows edselrt Linux - Newbie 3 10-23-2005 11:56 PM
copy files from linux to windows turbo_acura Linux - General 4 11-23-2004 02:46 PM


All times are GMT -5. The time now is 10:10 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration