find . -not -type d -exec file "{}" ";" | grep CRLF
# ./ide/.editorconfig: ASCII text, with very long lines (2299), with CRLF line terminators
# ./ide/jetbrains-intellij.md: Unicode text, UTF-8 text, with CRLF line terminators
# ./ide/eclipse-java-google-style.xml: XML 1.0 document, ASCII text, with CRLF line terminators
grep -Ilr $'\r$' -r .
# ./ide/.editorconfig
# ./ide/jetbrains-intellij.md
# ./ide/eclipse-java-google-style.xml
file file.txt
# file.txt: Unicode text, UTF-8 text, with CRLF line terminators
- DOS to Unix
vim file.txt -c "set ff=unix" -c ":wq"
file file.txt
# file.txt: Unicode text, UTF-8 text
- Unix to DOS
vim file.txt -c "set ff=dos" -c ":wq"
file file.txt
# file.txt: Unicode text, UTF-8 text, with CRLF line terminators