Questions tagged [dos2unix]

About dos2unix conversion program

unix2dos is a Unix tool to convert an ASCII text file from DOS format (carriage return and line break) to UNIX format (line break).

Also see

94 questions
431
votes
11 answers

How can I run dos2unix on an entire directory?

I have to convert an entire directory using dos2unix. I am not able to figure out how to do this.
Vivek Gaur
  • 4,579
  • 3
  • 17
  • 17
74
votes
2 answers

Convert line endings

I have been using d2u to convert line endings. After installing Puppy Linux I noticed that it does not come with d2u, but dos2unix. Then I noticed that Ubuntu is missing both by default. What is another way to convert line endings?
Zombo
  • 1
  • 62
  • 391
  • 407
37
votes
11 answers

Anything like dos2unix for Windows?

I have some shell scripts created on Windows. I want to run dos2unix on them. I have read that dos2unix works on Linux. Is there a way that I can convert my files to having Unix newlines while working on Windows?
Elvin
  • 2,131
  • 8
  • 23
  • 25
22
votes
3 answers

Why does my tool output overwrite itself and how do I fix it?

The intent of this question is to be a canonical that covers all sorts of questions whose answer boils down to "you have DOS line endings being fed into a Unix tool". Anyone with a related question should find a clear explanation of why they were…
Ed Morton
  • 188,023
  • 17
  • 78
  • 185
22
votes
4 answers

Git: Removing carriage returns from source-controlled files

I've got a Git repository that has some files with DOS format (\r\n line endings). I would like to just run the files through dos2unix (which would change all files to UNIX format, with \n line endings), but how badly would this affect history, and…
Blixt
  • 49,547
  • 13
  • 120
  • 153
20
votes
2 answers

Convert files to UNIX format using Maven

I have an application that is developed in a Windows environment. The application itself gets deployed to a Linux environment. Each time I deploy this application I have to convert executable files to UNIX format using dos2unix. I originally thought…
Dan Polites
  • 6,750
  • 10
  • 50
  • 56
19
votes
3 answers

Port dos2unix to brainfuck

I got into an argument over on SuperUser.com about useless answers and found myself challenging the other poster to answer the question in brainfuck. He didn't take me up on it, but now I'm curious. All the program needs to do is convert CRLF line…
quack quixote
  • 573
  • 1
  • 4
  • 14
18
votes
4 answers

dos2unix doesn't convert ^M

I exported results in a text file from a program running on Windows 7, and copied the file on Xubuntu 14.04. In a terminal, I ran dos2unix file.txt, which tells me converting file out_mapqtl.txt to Unix format. However, when I look at the file with…
tflutre
  • 3,354
  • 9
  • 39
  • 53
13
votes
2 answers

unix2dos (or dos2unix) in ant

How do I do unix2dos (or dos2unix) with ant. I.e. I want to change the newlines from linux newlines (if any) to dos newlines
flybywire
  • 261,858
  • 191
  • 397
  • 503
13
votes
8 answers

How to find a windows end of line (EOL) character

I have several hundred GB of data that I need to paste together using the unix paste utility in Cygwin, but it won't work properly if there are windows EOL characters in the files. The data may or may not have windows EOL characters, and I don't…
Stephen Turner
  • 2,574
  • 8
  • 31
  • 44
12
votes
3 answers

dos2unix: Binary symbol 0x04 found at line 1703

I download a file from the OECD http://stats.oecd.org/Index.aspx?datasetcode=CRS1 ('CRS 2013 data.txt') by selecting Export-> Related files. I want to work with this file in Ubuntu (14.04 LTS). When I run: dos2unix CRS\ 2013\ data.txt I…
dw8547
  • 258
  • 1
  • 2
  • 11
9
votes
5 answers

How to convert files from Dos to Unix

I am having several files which I want to convert from Dos to Unix. Is there any API or method which will help me to do this?
Code Hungry
  • 3,930
  • 22
  • 67
  • 95
9
votes
1 answer

dos2unix: Binary symbol found, skipping binary file

I am currently having an issue where my script is failing when trying to execute the dos2unix command on a file. This is what I have in the script: dos2unix -n data/file data/tmp_file dos2unix: Binary symbol found at line 21107611 dos2unix: Skipping…
MR JACKPOT
  • 206
  • 1
  • 3
  • 15
9
votes
5 answers

Why does dos2unix print to stderr?

When running dos2unix on a file I get the following printed to the terminal dos2unix: converting file to UNIX format ... In my attempt to suppress the output by sending it to /dev/null I noticed that this is sent out on stderr instead of…
user1881282
  • 152
  • 2
  • 7
8
votes
2 answers

How do I implement a pre-commit hook script in SVN that calls dos2unix to validate checked-in file

I was wondering if anyone here had some experience writing this type of script and if they could give me some pointers. I would like to modify this script to validate that the check-in file does not have a Carriage Return in the EOL formatting. The…
Julien Nephtali
  • 455
  • 1
  • 6
  • 12
1
2 3 4 5 6 7