cancel
Showing results for 
Search instead for 
Did you mean: 

dos2ux equivalent on linux

SOLVED
Go to solution
Jamal Asi
Advisor

dos2ux equivalent on linux

Is there an equivalent command on linux for the dos2ux hpux command?
3 REPLIES
Balaji N
Honored Contributor

Re: dos2ux equivalent on linux

[balaji@fire balaji]$ rpm -qi dos2unix
Name : dos2unix Relocations: (not relocateable)
Version : 3.1 Vendor: Red Hat, Inc.
Release : 7 Build Date: Mon 25 Jun 2001 08:00:39
AM IST
Install date: Mon 04 Mar 2002 03:53:02 PM IST Build Host: porky.devel.redha
t.com
Group : Applications/Text Source RPM: dos2unix-3.1-7.src.rpm
Size : 19179 License: Freely distributable
Packager : Red Hat, Inc. <>
Summary : Text file format converter
Description :
Dos2unix converts DOS or MAC text files to UNIX format.
[balaji@fire balaji]$ which dos2unix
/usr/bin/dos2unix

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Balaji N
Honored Contributor
Solution

Re: dos2ux equivalent on linux

and a few more tips to accomplish this form LOST (http://lost.sourceforge.net)

:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#1) LOST #025

Method #1: To convert a DOS text file to Unix so that extra
ASCII 13 does not show up when viewing / editing a DOS text
file : $cat filename.dos | tr -d '\015' > filename.unix

####[bish (at) nde.vsnl.net.in]###############################
:
:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#2) LOST #049

Method #2: using recode (if installed)
To convert a DOS text file to Unix so that the extra ASCII 13
does not show up, you can add the following in /etc/profile
or .profile (IF recode package is installed ...)

alias unix2dos='recode lat1..ibmpc'
alias dos2unix='recode ibmpc..lat1'

####[bish (at) nde.vsnl.net.in]###############################
:
:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#3) LOST #137

DOS text files with ^M can be cleared by pico editor. Load the
dos text file in pico, Do a small edit job on it. (e.g. place
a space and delete it again) .. Save .. Quit. All ^Ms gone !!

####[bish (at) nde.vsnl.net.in]###############################
:
:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#4) LOST #194

Need to remove all those ^M characters from a DOS file? Try :
$col -bx < dosfile > newfile

####[genesis (at) istar.ca]###################################

####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#5) LOST #217

In vim editor, it is just a matter of setting file-format (ff)
The steps are :
a) vim dosfile.txt b) :set ff=unix c) :wq

####[binand (at) cysphere.com]################################
:
:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : DOS to Unix conversion (#6) LOST #218

If you have vim editor installed, the following script will do
a DOS to Unix conversion:
#!/bin/sh # Save d2u, chmod +x d2u
vim -c ":set ff=unix" -c ":wq" $1 # Usage: d2u filename.txt

####[binand (at) cysphere.com]################################

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Caesar_3
Esteemed Contributor

Re: dos2ux equivalent on linux

Hello!

You have on linux dos2unix so download
ftp://rpmfind.net/linux/contrib/libc6/i386/dos2unix-3.1-3.i386.rpm

Caesar