1 , encoding Language conversion
Common Chinese language coding language hasgb2312,Big5,UTF8, sometimes a file is converted between different coding languages for some purpose ,Iconvcommand.
$ iconv-l
- L lists the supported encoding languages.
$ iconv-f encoding-t encoding filename [-o file]
-f represents the original encoding format, -t represents the destination encoding format, -o stdout to file.
and a good command. file , you can view the file encoding format and line break characters.
$ file filename
2 , line break conversion
Windowswith theLinuxdifferent line breaks, the former is^m$, i.e.CRLF, the latter is$, i.e.LF, both can be orderedUnix2dosorDos2unixconvert each other.
$ Unix2dos File
$ Dos2unix File
The newline character of the file can be viewed by the following command:
$ cat-a File
Encoding language conversion and line break conversion