Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-07-2006, 04:11 AM   #1
LQ Newbie
Registered: May 2006
Posts: 27

Rep: Reputation: 15
stripping ^m recursively.

Is there an easy way to go recursively through directories and strip the ^M from files that windows adds?
Old 06-07-2006, 04:27 AM   #2
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
You have command line utility called dos2unix that is meand exactly for that. Combine it with find and your have your script
find /path/to/base/dir -name "*.txt" -exec dos2unix {} \;
I strongly suggest you have a look at dos2unix man page and play arround with it before you try anything as there seems to be several versions arround with different option syntax. You might as well want to add some options so that the original file is kept and the output is written to a new one.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping down an ubuntu install CD toonlee Ubuntu 6 05-07-2006 08:51 AM
Chapter 5.33 Stripping LQ496873 Linux From Scratch 2 02-05-2006 09:42 PM
stripping of bash code? Lindows45 Linux - Newbie 2 03-01-2004 07:51 AM
Stripping down to basics sketchyfrog Linux - Newbie 4 02-24-2004 08:27 PM
Stripping down RedHat 9, where do I start? tobz Linux - General 19 07-27-2003 07:54 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration