<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: HowTo: UNIX / Linux Convert DOS Newlines CR-LF to Unix/Linux Format</title> <atom:link href="http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Steen</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-67656</link> <dc:creator>Steen</dc:creator> <pubDate>Sun, 29 Jan 2012 22:50:33 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-67656</guid> <description>Even easier:
$cd dir/with/stuff
$dos2unix *</description> <content:encoded><![CDATA[<p>Even easier:<br
/> $cd dir/with/stuff<br
/> $dos2unix *</p> ]]></content:encoded> </item> <item><title>By: Steen</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-67655</link> <dc:creator>Steen</dc:creator> <pubDate>Sun, 29 Jan 2012 22:49:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-67655</guid> <description>Thanks!
I was just about to write a shellscript for this, but then I just googled it because I forgot if it was /n to /r or how :P It works!!!
Side note:
For people with problems about duplicates moved from Windows to Linux on Garry&#039;s Mod servers they should use &quot;dos2unix STEAM*/*.txt&quot; to avoid trying to convert directories. There&#039;s a lot of trouble with user created directories otherwise. The program tries to convert directories - which is a bit annoying.</description> <content:encoded><![CDATA[<p>Thanks!<br
/> I was just about to write a shellscript for this, but then I just googled it because I forgot if it was /n to /r or how :P It works!!!</p><p>Side note:<br
/> For people with problems about duplicates moved from Windows to Linux on Garry&#8217;s Mod servers they should use &#8220;dos2unix STEAM*/*.txt&#8221; to avoid trying to convert directories. There&#8217;s a lot of trouble with user created directories otherwise. The program tries to convert directories &#8211; which is a bit annoying.</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-50648</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Wed, 10 Nov 2010 10:47:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-50648</guid> <description>Use &lt;a href=&quot;http://www.cyberciti.biz/faq/bash-for-loop/&quot; rel=&quot;nofollow&quot;&gt;bash for loop&lt;/a&gt;:
&lt;pre&gt;for f in /path/to/src/*
do
dos2unix &quot;$f&quot;
done&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Use <a
href="http://www.cyberciti.biz/faq/bash-for-loop/" rel="nofollow">bash for loop</a>:</p><pre>for f in /path/to/src/*
do
  dos2unix "$f"
done</pre>]]></content:encoded> </item> <item><title>By: sankar</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-50641</link> <dc:creator>sankar</dc:creator> <pubDate>Wed, 10 Nov 2010 08:12:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-50641</guid> <description>I have to convert 50 files at one shot to Unix format. Is there a way to do it?</description> <content:encoded><![CDATA[<p>I have to convert 50 files at one shot to Unix format. Is there a way to do it?</p> ]]></content:encoded> </item> <item><title>By: Allan</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-49923</link> <dc:creator>Allan</dc:creator> <pubDate>Tue, 05 Oct 2010 14:25:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-49923</guid> <description>The sed ... echo \\\r worked fine for us on AIX version 6.1 to convert Unix to DOS.  Thanks!</description> <content:encoded><![CDATA[<p>The sed &#8230; echo \\\r worked fine for us on AIX version 6.1 to convert Unix to DOS.  Thanks!</p> ]]></content:encoded> </item> <item><title>By: Dzmitry Lazerka</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-44652</link> <dc:creator>Dzmitry Lazerka</dc:creator> <pubDate>Fri, 13 Nov 2009 09:33:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-44652</guid> <description>sed &#039;s/$&#039;&quot;/`echo \\\r`/&quot; input.txt &gt; output.txt
leaves one extra CR at the end of the file.
This makes the suggestion broken.</description> <content:encoded><![CDATA[<p>sed &#8216;s/$&#8217;&#8221;/`echo \\\r`/&#8221; input.txt &gt; output.txt<br
/> leaves one extra CR at the end of the file.<br
/> This makes the suggestion broken.</p> ]]></content:encoded> </item> <item><title>By: David Schiavone</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-43070</link> <dc:creator>David Schiavone</dc:creator> <pubDate>Thu, 13 Aug 2009 10:49:54 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-43070</guid> <description>Impressive i would say.. I used dos2unix on CentOS 5.3 without any problems and a file of 300,000 got modified in less then 15 secs... compared it to using notepad++ on windows and your computer would freeze up for at least 2 mins for the same file ;).</description> <content:encoded><![CDATA[<p>Impressive i would say.. I used dos2unix on CentOS 5.3 without any problems and a file of 300,000 got modified in less then 15 secs&#8230; compared it to using notepad++ on windows and your computer would freeze up for at least 2 mins for the same file ;).</p> ]]></content:encoded> </item> <item><title>By: Calvin Smith</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-37150</link> <dc:creator>Calvin Smith</dc:creator> <pubDate>Wed, 12 Dec 2007 06:23:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-37150</guid> <description>Dear John,
Actually, the scripts are correct. Hexdump is reversing the byte order (integer format)
Try this for example and as a simplified script:
$ echo TEST &#124; sed &#039;s/$/\r/&#039; &#124; hexdump -C
Then try it without the -C.
You will notice that the 54&#039;s (T) are next to each other. (ETTS)</description> <content:encoded><![CDATA[<p>Dear John,</p><p>Actually, the scripts are correct. Hexdump is reversing the byte order (integer format)</p><p>Try this for example and as a simplified script:</p><p>$ echo TEST | sed &#8216;s/$/\r/&#8217; | hexdump -C</p><p>Then try it without the -C.<br
/> You will notice that the 54&#8242;s (T) are next to each other. (ETTS)</p> ]]></content:encoded> </item> <item><title>By: John Cairns</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-36790</link> <dc:creator>John Cairns</dc:creator> <pubDate>Wed, 05 Sep 2007 14:44:27 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-36790</guid> <description>Your UNIX to DOS sed script is incorrect if what you want is CRLF.
$ echo &#124; sed &#039;s/$&#039;&quot;/`echo \\\r`/&quot; &#124; hexdump
0000000 0a0d
ASCII 0/13 is decimal 013, hex 0d, octal 015, bits 00001101: called ^M, CR
Official name: Carriage Return
ASCII 0/10 is decimal 010, hex 0a, octal 012, bits 00001010: called ^J, LF, NL
Official name: Line Feed
For CRLF you want 0d0a.  Your producing LFCR here.</description> <content:encoded><![CDATA[<p>Your UNIX to DOS sed script is incorrect if what you want is CRLF.</p><p>$ echo | sed &#8216;s/$&#8217;&#8221;/`echo \\\r`/&#8221; | hexdump<br
/> 0000000 0a0d</p><p>ASCII 0/13 is decimal 013, hex 0d, octal 015, bits 00001101: called ^M, CR<br
/> Official name: Carriage Return</p><p>ASCII 0/10 is decimal 010, hex 0a, octal 012, bits 00001010: called ^J, LF, NL<br
/> Official name: Line Feed</p><p>For CRLF you want 0d0a.  Your producing LFCR here.</p> ]]></content:encoded> </item> <item><title>By: nigel</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-9023</link> <dc:creator>nigel</dc:creator> <pubDate>Fri, 02 Feb 2007 13:42:27 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-9023</guid> <description>I had tried the suggestion from Wikipedia and that did not work. This solution worked perfectly first time. THANK YOU.</description> <content:encoded><![CDATA[<p>I had tried the suggestion from Wikipedia and that did not work. This solution worked perfectly first time. THANK YOU.</p> ]]></content:encoded> </item> <item><title>By: bruce wolford</title><link>http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-6475</link> <dc:creator>bruce wolford</dc:creator> <pubDate>Thu, 04 Jan 2007 02:10:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/#comment-6475</guid> <description>Howto: UNIX or Linux convert DOS newlines CR-LF to Unix/Linux format
THANK YOU! to who ever wrote this.  I&#039;ve been messing around with this for quite a while.  This even works on AIX&#039;s legacy version of sed.  My day has been so made by this little nugget.</description> <content:encoded><![CDATA[<p>Howto: UNIX or Linux convert DOS newlines CR-LF to Unix/Linux format</p><p>THANK YOU! to who ever wrote this.  I&#8217;ve been messing around with this for quite a while.  This even works on AIX&#8217;s legacy version of sed.  My day has been so made by this little nugget.</p> ]]></content:encoded> </item> </channel> </rss>
