Skip to main content
added 147 characters in body
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

With dos2unix abc.txt you have successfully converted the DOS text file to a Unix text file.

The file still contains a newline character. This is a totally valid thing to have in a text file. It's simply an empty line of text.

If you want to totally truncate the file, then

>abc.txt 

in the shell would do that.


To remove empty lines at the end of a file, see "https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof".

With dos2unix abc.txt you have successfully converted the DOS text file to a Unix text file.

The file still contains a newline character. This is a totally valid thing to have in a text file. It's simply an empty line of text.

If you want to totally truncate the file, then

>abc.txt 

in the shell would do that.

With dos2unix abc.txt you have successfully converted the DOS text file to a Unix text file.

The file still contains a newline character. This is a totally valid thing to have in a text file. It's simply an empty line of text.

If you want to totally truncate the file, then

>abc.txt 

in the shell would do that.


To remove empty lines at the end of a file, see "https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof".

Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

With dos2unix abc.txt you have successfully converted the DOS text file to a Unix text file.

The file still contains a newline character. This is a totally valid thing to have in a text file. It's simply an empty line of text.

If you want to totally truncate the file, then

>abc.txt 

in the shell would do that.