Convert DOS to Unix Line Feed on all Files in Directory

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the steps to convert a directory recursively from Carriage Return Line Feed (CRLF) to Unix Line Feed (LF) on Mac OS X or Linux.


Prerequisites


Install dos2unix

Mac OS X

  1. brew update
    
  2. brew install dos2unix
    
  3. find ./ -type f -exec dos2unix {} \;
    

RHEL

  1. yum update
    
  2. yum install dos2unix
    
  3. find ./ -type f -exec dos2unix {} \;
    


Sources