Linux下文件以及文件名编码转换
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下文件以及文件名编码转换的更多相关文章
- Gnu Linux下文件的字符编码及转换工具
/********************************************************************* * Author : Samson * Date ...
- Linux下查看文件编码,文件编码格式转换和文件名编码转换
linux相关 2008-10-07 10:46 阅读1392 评论0 字号: 大大 中中 小小 如果你需要在Linux中 操作windows下的文件,那么你可能会经常遇到文件编 ...
- linux下文件编码格式转换方法(gb18030/utf-8)
文章转载自:http://www.firekyrin.com/archives/249.html linux下文件编码格式转换方法(gb18030/utf-8) 在Linux做开发或者系统管理遇到乱 ...
- linux下文件结束符
linux下文件结束符,我试过了所有的linux,发现其文件的结束符都是以0a即LF结束的,这个是操作系统规定的,windows下是\r\n符结束,希望可以帮助大家. -------------转:来 ...
- linux下文件的复制、移动与删除
linux下文件的复制.移动与删除命令为:cp,mv,rm 一.文件复制命令cp 命令格式:cp [-adfilprsu] 源文件(source) 目标文件(destination) ...
- Linux下文件的权限
一.Linux下查看文件属性 命令为: [root@localhost ~]# ls -al 结果: ls是『list』的意思,重点在显示文件的文件名与相关属性.而选项『-al』则表示列出所有的文件详 ...
- Windows与Linux下文件操作监控的实现
一.需求分析: 随着渲染业务的不断进行,数据传输渐渐成为影响业务时间最大的因素.究其原因就是因为数据传输耗费较长的时间.于是,依托于渲染业务的网盘开发逐渐成为迫切需要解决的需求.该网盘的实现和当前市场 ...
- LINUX下文件编译
body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...
- Linux 下文件
Linux下文件的三个时间(Atime,Mtime,Ctime) [root@node ~]# stat install.log File: `install.log' Size: Blocks: ...
随机推荐
- ubuntu_ root change to user
(1)从user用户切换到root用户 不管是用图形模式登录Ubuntu,还是命令行模式登录,我们会发现缺省的用户是user 但是当我们需要执行一些具有root权限的操作(如修还系统文件)时,经常需要 ...
- sass编译命令
sass编译一个文件的方式 sass xx.scss:xx.css 这种方式只能编译一次,要是想一直监控编译,只要有保存更改就会立即编译,那么就需要下面这条命令了 sass --watch xx.sc ...
- 微信小程序开发之页面数据绑定
js:Page( { data:{ parmer:"", //字符串参数 userinfo:{ userphone:"", ...
- C#字典常用技巧
说明 必须包含名空间System.Collection.Generic Dictionary里面的每一个元素都是一个键值对(由二个元素组成:键和值) 键必须是唯一的,而值不需要唯 ...
- ubuntu 安装 lamp 和配置虚拟机
1:sudo passwd root #设定root密码 su 切换 exit 退出 ,或者 普通用户下 加sudo 2:sudo apt-get update #更新软件列表 3:sudo ...
- 1107 Social Clusters (30 分)
When register on a social network, you are always asked to specify your hobbies in order to find som ...
- 使用Decimal.js解决前端计算金钱失真问题
1.加载 $ npm install --save decimal.js 2.页面导入 import {Decimal} from 'decimal.js' 3.使用 // 加法 new Decima ...
- 【UVA - 156 】Ananagrams (set,map,vector)
Ananagrams Descriptions: Most crossword puzzle fans are used to anagrams--groups of words with the ...
- shell学习(5)- sort
Linux sort命令用于将文本文件内容加以排序. sort可针对文本文件的内容,以行为单位来排序. 参数如下: -b 忽略每行前面开始出的空格字符. -c 检查文件是否已经按照顺序排序. -d 排 ...
- Bootstrap里的文件作用
Bootstrap里的文件分别表示什么?都有什么用? bootstrap.css bootstrap.min.css bootstrap-responsive.css bootstrap-respon ...