The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Ubuntu
.
google unix.com



Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ubuntu to pure debian Texasone SuSE 13 06-01-2008 12:20 PM
TA08-137A: Debian/Ubuntu OpenSSL Random Number Generator Vulnerability iBot Security Advisories (RSS) 0 05-16-2008 02:50 PM
Ubuntu Linux Toolbox: 1000+ Commands For Ubuntu And Debian Power ... - Business Wire iBot UNIX and Linux RSS News 0 12-19-2007 10:50 AM
Ubuntu Linux Toolbox: 1000+ Commands For Ubuntu And Debian Power ... - PR-Inside.com iBot UNIX and Linux RSS News 0 12-19-2007 09:00 AM
Memory-waste in Ubuntu/Debian? riwa UNIX for Dummies Questions & Answers 0 03-04-2006 05:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-17-2007
royalibrahim royalibrahim is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 86
Debian (ubuntu) file problem after ftp

Hi,

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 (permalink)  
Old 10-17-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
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 (permalink)  
Old 10-17-2007
royalibrahim royalibrahim is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 86
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"
psftp>

FYI, I am connecting to Linux machine using Cygwin X window system.
  #4 (permalink)  
Old 10-17-2007
sad_angle's Avatar
sad_angle sad_angle is offline
Registered User
  
 

Join Date: Jun 2001
Location: Madison, WI
Posts: 75
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 (permalink)  
Old 10-17-2007
royalibrahim royalibrahim is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 86
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.
Closed Thread

Bookmarks

Tags
linux, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0