Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running a RHEL machine that was, by default, running vsftpd, the very secure ftp daemon. Due to its lack of configuration and symlink support, I've switched to pure-ftpd.

I noticed that files that used to have linefeeds \n now instead have two carriage returns \r.

I've tried switching back in forth between the servers, and the file is untouched, but it seems that the FTP server is doing something different. Using vi/vim as well as cat show a single linefeed, but the downloaded file from pure-ftpd shows two carriage returns. Note that this applied only to certain files, many files transfer normally, including all system-created files.

What causes this to happen? If this isn't a setting, how would I fix the files without opening them one by one and replacing \r\r with \n?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You need to tell your client to transfer in binary mode.

share|improve this answer
    
One question - why would this change between FTP server types if this is a client-side option? –  hexacyanide May 24 '13 at 6:40
    
It's a negotiated option. I believe the default is set by the server, but I'm not sure of that. –  Falcon Momot May 24 '13 at 7:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.