The octaldump of the unix2dos / dos2unix

Let’s start out with a file we’ve created in unix (solaris). When doing an octal dump (od) of this file, we’ll see that the end-of-line (newline) is represented with an n

bash-2.03$ cat test
linetest
bash-2.03$ od -c test
0000000 l i n e t e s t n
0000011

Let’s convert this file to a DOS (windows) file:

bash-2.03$ unix2dos test test2

If we do an octaldump of this newly generated file, then we’ll see that it had a “return” and a “newline”.

bash-2.03$ cat test2
linetest
bash-2.03$ od -c test2
0000000 l i n e t e s t r n
0000012

NOTE(s):
– the unix2dos & dos2unix are eachother’s equivalents…
– the commands can be used to convert files for to be compatible for the other

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.