Debian (ubuntu) file problem after ftp

Thread Tools Search this Thread
Operating Systems Linux Ubuntu Debian (ubuntu) file problem after ftp
# 1  
Old 10-17-2007
Debian (ubuntu) file problem after ftp


I am using Debian (ubuntu). whenever I ftp file from Windows to Debian, the file is being shown as DOS while editing in vi. The control characters are not visible and I couldn't remove the '^M' character. So please help me how to make it Linux specific file to use it for Linux specific tasks.
# 2  
Old 10-17-2007
Are you refering to transfering the file as ascii or binary?

When transfering text files, you should transfer as ascii. This will cause both client and server to do the appropriate thing for line terminators.

Binary files should be transferred as binary.

When you put a file, it will tell you which mode it is using as it transfers the file.
# 3  
Old 10-17-2007
actually I am using "psftp.exe" (a putty tool) for ftp'ing files from Windows machine to Linux machine. So in the psftp we cannot specify ascii or binary mode, if we specify it, it will throw error. I don't know why.

psftp> ascii
psftp: unknown command "ascii"

FYI, I am connecting to Linux machine using Cygwin X window system.
# 4  
Old 10-17-2007
I dearly suggest that you use ftp from the command prompt.

open a terminal, then type man ftp, you can get it done in 5 min. If it does not work, at least it will generate an error that I can relate to it's results.
# 5  
Old 10-17-2007
Actually I tried several times connecting Linux pc through ftp from DOS command prompt but could not succeed. It only happens when "sftp.exe" is used (I guess it is a secure ftp file). But I found the solution for my problem. A file has to be created (with some data) in the Linux environment and the windows file which is ftp'd should be concatenated to this file. So now we are able to see the "^M" control characters of the file in vi, as we have mixup of Linux based and DOS based newline characters in the same file and now it is possible to delete these DOS characters. But if the file contains data carriage return'd only by DOS newline character (ASCII-13), the vi editor is not showing those character and consider this file as "DOS" based file, a strange behaviour and I could not apply any method to replace this character using vi or sed or even with Perl. That is why I said to create a Linux based file with some data.

N.B: while a file containing only DOS newline character, then vi's :set list (or) od command (or) strings, nothing is useful.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Linux

What is the lightest distro for using Debian/Ubuntu softwares

Which distro uses lowest system resource (when installed on hard_disk/usb.) where I can install software from Debian OR Ubuntu repository? I found Quelitu which is based on Lubuntu, but uses less memory as given on their site. There are lighter distros but most of them are based on Slackware. I... (0 Replies)
Discussion started by: iripu
0 Replies

2. Solaris

Video capture and editing on Solaris vs Debian vs Ubuntu

I am interested in doing some heavy video work. I have a ADVC 110 Video capture device, which I am using to capture VHS video tapes, which I will convert on the server to DVD format and burn to DVD's using DVD production software. I will also take the captured video file and split it up in parts... (1 Reply)
Discussion started by: Marcus Aurelius
1 Replies

3. SuSE

ubuntu to pure debian

ok, im going to start off by saying i am a newbee so some of the stuff i say may not be right. but anyways, right now i am using ubuntu hardy for my main distrobution. i love it and all, but the main reason i switched to linux (besides drm and the blue screen i see on my comp about ten times a... (13 Replies)
Discussion started by: Texasone
13 Replies

4. UNIX for Dummies Questions & Answers

Memory-waste in Ubuntu/Debian?

I have 512 mem on this laptop, though 'top' tells me I only have 380. However, Ubuntu is using 288 mb of memory, when I only have 3 terminals, running lynx, vim(for this file) and (of course) top. Considering it I have lynx running a 600 page txt file, which of course would eat some memory but 300?... (0 Replies)
Discussion started by: riwa
0 Replies
Login or Register to Ask a Question