1.查看文件编码方式--file 文件名(但不是很准确)

yang@mint-linux ~ $ file baidu.html
baidu.html: HTML document, UTF-8 Unicode text, with very long lines, with no line terminators
yang@mint-linux ~ $ file sina.html
sina.html: HTML document, ISO-8859 text, with very long lines, with CRLF, LF line terminators

2.转换文件编码--iconv -f 源编码 -t 目标编码 源文件名 > 目标文件名

yang@mint-linux ~ $ file sina.html
sina.html: HTML document, ISO-8859 text, with very long lines, with CRLF, LF line terminators
yang@mint-linux ~ $ iconv -f gbk -t utf8 sina.html > sina_utf8.html
yang@mint-linux ~ $ file sina_utf8.html
sina_utf8.html: HTML document, UTF-8 Unicode text, with very long lines, with CRLF, LF line terminators

3.转换文件名编码--convmv -f 源编码 -t 目标编码 文件名 --notext(如果不加--notext则只是显示结果,不实际转换)

yang@mint-linux ~ $ touch 中文.txt
yang@mint-linux ~ $ convmv -f utf-8 -t gbk 中文.txt --notest
Your Perl version has fleas #37757 #49830
mv "./中文.txt" "./����.txt"
Ready!

Linux下文件以及文件名编码转换的更多相关文章

  1. Gnu Linux下文件的字符编码及转换工具

    /*********************************************************************  * Author  : Samson  * Date   ...

  2. Linux下查看文件编码,文件编码格式转换和文件名编码转换

    linux相关   2008-10-07 10:46   阅读1392   评论0   字号: 大大  中中  小小  如果你需要在Linux中 操作windows下的文件,那么你可能会经常遇到文件编 ...

  3. linux下文件编码格式转换方法(gb18030/utf-8)

    文章转载自:http://www.firekyrin.com/archives/249.html linux下文件编码格式转换方法(gb18030/utf-8) 在Linux做开发或者系统管理遇到乱 ...

  4. linux下文件结束符

    linux下文件结束符,我试过了所有的linux,发现其文件的结束符都是以0a即LF结束的,这个是操作系统规定的,windows下是\r\n符结束,希望可以帮助大家. -------------转:来 ...

  5. linux下文件的复制、移动与删除

    linux下文件的复制.移动与删除命令为:cp,mv,rm 一.文件复制命令cp     命令格式:cp [-adfilprsu] 源文件(source) 目标文件(destination)      ...

  6. Linux下文件的权限

    一.Linux下查看文件属性 命令为: [root@localhost ~]# ls -al 结果: ls是『list』的意思,重点在显示文件的文件名与相关属性.而选项『-al』则表示列出所有的文件详 ...

  7. Windows与Linux下文件操作监控的实现

    一.需求分析: 随着渲染业务的不断进行,数据传输渐渐成为影响业务时间最大的因素.究其原因就是因为数据传输耗费较长的时间.于是,依托于渲染业务的网盘开发逐渐成为迫切需要解决的需求.该网盘的实现和当前市场 ...

  8. LINUX下文件编译

    body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...

  9. Linux 下文件

     Linux下文件的三个时间(Atime,Mtime,Ctime) [root@node ~]# stat install.log File: `install.log' Size: Blocks: ...

随机推荐

  1. Number()、parseInt()、parseFloat()的区别:

    Number().parseInt().parseFloat()的区别: Number()的强制类型转换与parseInt()和parseFloat()方法的处理方式相似,只是它转换的是整个值,而不是 ...

  2. ES6笔记总结

    常用命令 函数的rest参数和扩展 promise使用 module.exports和Es6 import/export的使用 function sum(x,y,z){ let total = 0; ...

  3. CF 429B B.Working out 四个角递推

    B. Working outtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutpu ...

  4. IT兄弟连 JavaWeb教程 Servlet会话跟踪 Cookie技术原理

    Cookie使用HTTPHeader传递数据.Cookie机制定义了两种报头,Set-Cookie报头和Cookie报头.Set-Cookie报头包含于Web服务器的响应头(ResponseHeade ...

  5. 【书评】【不推荐】《TensorFlow:实战Google深度学习框架》(第2版)

    参考书 <TensorFlow:实战Google深度学习框架>(第2版) 这本书我老老实实从头到尾看了一遍(实际上是看到第9章,刚看完,后面的实在看不下去了,但还是会坚持看的),所有的代码 ...

  6. 了解cookie

    1.cookie数据会自动在Web浏览器和Web服务器之间传输的,因此服务端脚本就可以读,写存储在客户端的cookie值. 2.在javascript中使用cookie不会采用任何加密机制,因此是不安 ...

  7. 黑马Lambda表达式学习 Stream流 函数式接口 Lambda表达式 方法引用

  8. Jquery | 基础 | 事件的链式写法

    $(".title").click(function () { $(this).addClass("curcol").next(".content&q ...

  9. spring+mybits 整合所需jar包的下载路径(亲测有效)

    1.spring jar包:http://repo.springsource.org/libs-release-local/org/springframework/spring/5.0.0.RELEA ...

  10. mongodb-CURD

    插入 import pymongo conn = pymongo.MongoClient('mongodb://192.168.10.10:27017') mydb = conn['myDB'] my ...