<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Unix2dos</id>
	<title>Unix2dos - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Unix2dos"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Unix2dos&amp;action=history"/>
	<updated>2026-05-07T18:36:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Unix2dos&amp;diff=4085926&amp;oldid=prev</id>
		<title>imported&gt;TTWIDEE: Fixed spacing</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Unix2dos&amp;diff=4085926&amp;oldid=prev"/>
		<updated>2025-01-07T16:24:14Z</updated>

		<summary type="html">&lt;p&gt;Fixed spacing&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{sources|date=November 2020}}&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = unix2dos &amp;amp; dos2unix&lt;br /&gt;
| logo                   = &lt;br /&gt;
| screenshot             = &lt;br /&gt;
| screenshot size        = &lt;br /&gt;
| caption                = &lt;br /&gt;
| author                 = John Birchfield&lt;br /&gt;
| developer              = Benjamin Lin, Bernd Johannes Wuebben, Christian Wurll, Erwin Waterlander&lt;br /&gt;
| released               = {{Start date and age|1989}}&lt;br /&gt;
| latest release version = {{wikidata|property|preferred|references|edit|P348|P548=Q2804309}}&lt;br /&gt;
| latest release date    = {{Start date and age|{{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}}|df=yes}}&lt;br /&gt;
| operating system       = [[Unix-like]], [[DOS]], [[OS/2]], [[Microsoft Windows|Windows]]&lt;br /&gt;
| platform               = [[Cross-platform]]&lt;br /&gt;
| genre                  = [[Command (computing)|Command]]&lt;br /&gt;
| license                = [[FreeBSD]] style license&lt;br /&gt;
| website                = {{URL|https://waterlan.home.xs4all.nl/dos2unix.html}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;{{code|unix2dos}}&amp;#039;&amp;#039;&amp;#039; (sometimes named {{code|todos}} or {{code|u2d}}) is a tool to convert [[Newline|line breaks]] in a [[text file]] from [[Unix]] format (Line feed) to [[DOS]] format ([[carriage return]] + Line feed) and vice versa.  When invoked as {{code|unix2dos}} the program will convert a Unix text file to DOS format, when invoked as {{code|dos2unix}} it will convert a DOS text file to Unix format.&amp;lt;ref&amp;gt;A practical guide to Linux. Mark G. Sobell {{ISBN|0-13-147823-0}} Page 55&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Unix2dos and dos2unix are not part of the Unix standard. Commercial Unixes usually come with their own implementation of unix2dos/dos2unix, like SunOS/Solaris&amp;#039;s &amp;#039;&amp;#039;dos2unix/unix2dos&amp;#039;&amp;#039;, HP-UX&amp;#039;s &amp;#039;&amp;#039;dos2ux/ux2dos&amp;#039;&amp;#039; and Irix&amp;#039;s &amp;#039;&amp;#039;to_unix/to_dos&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
There exist many open source alternatives with different command names and options like &amp;#039;&amp;#039;dos2unix/unix2dos&amp;#039;&amp;#039;, &amp;#039;&amp;#039;d2u/u2d&amp;#039;&amp;#039;, &amp;#039;&amp;#039;{{Not a typo|fromdos/todos}}&amp;#039;&amp;#039;, &amp;#039;&amp;#039;endlines&amp;#039;&amp;#039;, &amp;#039;&amp;#039;flip&amp;#039;&amp;#039;. The multi-call binary [[busybox]] includes an implementation of &amp;#039;&amp;#039;unix2dos/dos2unix&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
See the [[Man page|manual page]] of the respective commands.&lt;br /&gt;
&lt;br /&gt;
==Alternatives to unix2dos conversion==&lt;br /&gt;
{{blist&lt;br /&gt;
|recode &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ recode latin1..dos file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Open the file with Windows Write ([[WordPad]]) or Microsoft Word, and save in &amp;quot;plain text&amp;quot; format.&lt;br /&gt;
| Similar results can be achieved with different Unix tools to change the trailing newline &amp;#039;\n&amp;#039; to a combination of carriage return and newline characters &amp;#039;\r\n&amp;#039;, for example with [[perl]]  or the GNU implementation of [[sed]] in-line editing:&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot; inline&amp;gt;&lt;br /&gt;
$ perl -i -p -e &amp;#039;s|[\r\n]+|\r\n|g&amp;#039; file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot; inline&amp;gt;&lt;br /&gt;
$ sed -i -n -z &amp;#039;s/\r*\n/\r\n/g;p&amp;#039; file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Alternatives to dos2unix conversion==&lt;br /&gt;
For the opposite conversion ({{mono|[[dos2unix]]}}) it is possible to use, for example, the utility [[tr (Unix)|tr]] with the {{code|-d &amp;#039;\r&amp;#039;}} flag to remove the carriage return characters:&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot; inline&amp;gt;&lt;br /&gt;
$ tr -d &amp;#039;\r&amp;#039; &amp;lt; file &amp;gt; file2 # For ASCII and other files which do not contain multibyte characters (Not utf-8 safe).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot; inline&amp;gt;&lt;br /&gt;
$ perl -i -p -e &amp;#039;s/\r//g&amp;#039; file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot; inline&amp;gt;&lt;br /&gt;
$ sed -i -e &amp;#039;s/\r//g&amp;#039; file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The above method assumes there are only DOS line breaks in the input file. Any Mac line breaks (\r) present in the input will be removed.&lt;br /&gt;
&lt;br /&gt;
An alternative to the dos2unix conversion is possible by using the {{code|col}} command that is available on [[Linux]] and other Unix-like operating systems, including Mac OS X.  In the following case, InFile contains the undesired DOS (^M) line endings.  After execution, OutFile is either created or replaced, and contains UNIX line endings.  The {{code|-b}} option tells {{code|col}} not to output backspace characters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ col -b &amp;lt; InFile &amp;gt; OutFile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Newline]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://www.thefreecountry.com/tofrodos/ Tofrodos] - software that provides dos2unix and unix2dos&lt;br /&gt;
* [http://waterlan.home.xs4all.nl/dos2unix.html Dos2Unix] - Dos2Unix / Unix2Dos - Text file format converters&lt;br /&gt;
&lt;br /&gt;
{{Unix commands}}&lt;br /&gt;
&lt;br /&gt;
[[Category:System administration]]&lt;br /&gt;
[[Category:Unix text processing utilities]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{unix-stub}}&lt;/div&gt;</summary>
		<author><name>imported&gt;TTWIDEE</name></author>
	</entry>
</feed>