码迷,mamicode.com
首页 > 其他好文 > 详细

如何查看文件的编码

时间:2017-05-18 18:40:10      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:char   linux   let   nat   tle   linu   rmi   encoding   文件的   

https://www.shellhacks.com/linux-check-change-file-encoding/

在某一个目录下,直接执行file *

 

$ file *
chucklu.autoend.js: HTML document, UTF-8 Unicode text, with very long lines, with CRLF line terminators
custom.css: UTF-8 Unicode text, with CRLF line terminators
SimpleMemory.css: UTF-8 Unicode text, with CRLF line terminators

 

$ file *
chucklu.autoend.js: HTML document, Little-endian UTF-16 Unicode text, with very long lines, with CRLF line terminators
custom.css: UTF-8 Unicode text, with CRLF line terminators
SimpleMemory.css: UTF-8 Unicode text, with CRLF line terminators

 

$ file -bi chucklu.autoend.js
text/html; charset=utf-8

 

$ file -bi custom.css
text/plain; charset=utf-8

 

-b,--brief   Don’t print filename (brief mode)

-i, --mime   Print filetype and encoding

 

如何查看文件的编码

标签:char   linux   let   nat   tle   linu   rmi   encoding   文件的   

原文地址:http://www.cnblogs.com/chucklu/p/6874820.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!