Skip to navigation
Linux command to replace all windows CRLF line endings with Linux LF
17.09.25
You can use dos2unix program ``` apt-get install dos2unix ``` To convert a single file: ``` dos2unix yourtextfile ``` To convert multiple files, you can use find with xargs: ``` find . -name '*.txt' -print0 | xargs -0 dos2unix ``` Or, to find all files with CRLF endings and convert them: ``` find . -type f | xargs file | grep CRLF | cut -d: -f1 | xargs dos2unix ```
https://man.archlinux.org/man/dos2unix.1.en
Reply
Anonymous
Information Epoch 1758160897
Make every program a filter.
Home
Notebook
Contact us