标签归档文章: fileformat

linux(unix)文件格式类型以及dos和unix文件格式的转换

首先我们来看下linux下是如何识别文件格式的。unix,dos,mac都分别有自己使用的换行符。
The line terminator expected for each file format is:
unix LF only (each line ends with an LF character).
dos CRLF (each line ends with two characters, CR then LF).
mac CR only (each line ends with a CR character).
CR is carriage return (return cursor to left margin), which is Ctrl-M or ^M or hex 0D.
LF is linefeed (move cursor down), which is Ctrl-J or ^J or hex 0A. Sometimes, LF is written as NL (newline).

在linux shell里做个试验。 (注意^M符号通过ctrl+v 然后输入 ctrl+M)
更多…