O
O
Optimus2015-03-08 16:17:33
linux
Optimus, 2015-03-08 16:17:33

How to do a Linux line break in Win?

If you transfer files created in Win to Linux, then you need to change the line feed. I heard you can do it with the help of the dos2unix utility (if you don't do it, there will be a "no such file or directory/bash" error). The utility is downloaded, but something did not understand how to run it. Is there an alternative for Windows?
Another question: if a text file is generated using php and a line break / n is done, then this text file (more precisely, a line break in it) will be correct from the point of view of linux?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
SagePtr, 2015-03-08
@SagePtr

In more or less advanced text editors (Akelpad, Sublime text, Notepad++, etc.) you can usually select the end of line character.
And about generating a text file using PHP - depending on how exactly you write the end of the line there. If the PHP_EOL constant, then it will be LF on Linux, CRLF on Windows. And if you manually put end-of-line characters, then which ones you write down, they will be.

S
Swartalf, 2015-03-10
@Swartalf

Primitive variant.
open the file with notepad++ and select the desired format via "Edit - EOL Convertion".

E
Eddy_Em, 2015-03-08
@Eddy_Em

What nonsense? What the hell is the \n character in the filename?

A
Armenian Radio, 2015-03-08
@gbg

Launching the utility is very simple. From the command line:
dos2unix имя_файла

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question