How to find out line-endings in a text file?

前端 未结 11 1055
一向
一向 2020-11-28 00:15

I\'m trying to use something in bash to show me the line endings in a file printed rather than interpreted. The file is a dump from SSIS/SQL Server being read in by a Linux

11条回答
  •  臣服心动
    2020-11-28 01:01

    In vi...

    :set list to see line-endings.

    :set nolist to go back to normal.

    While I don't think you can see \n or \r\n in vi, you can see which type of file it is (UNIX, DOS, etc.) to infer which line endings it has...

    :set ff

    Alternatively, from bash you can use od -t c or just od -c to display the returns.

提交回复
热议问题