Demonstrate some examples of working with line-endings differences.
When switching between WSL and Windows line endings will sometimes be converted.
NOTES:
- It seems if VSCode detects line endings it continues to use that style.
Use a code extension to render the line endings.
code --install-extension medo64.render-crlf
sudo apt install dos2unix
# show line endings
cat --show-all ./dos.txt
# show file type
file ./dos.txt
# show line endings
cat --show-all ./unix.txt
# show file type
file ./unix.txt
dos2unix ./dos.txt
cat --show-all ./dos.txt
unix2dos ./unix.txt
cat --show-all ./unix.txt
- How to find out line-endings in a text file? here