Answer the question
In order to leave comments, you need to log in
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
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.
Primitive variant.
open the file with notepad++ and select the desired format via "Edit - EOL Convertion".
Launching the utility is very simple. From the command line:dos2unix имя_файла
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question