1、vi uzip(文件名)
2、复制以下Python程序

 #!/usr/bin/env python
# -*- coding: utf-8 -*-
# uzip.py import os
import sys
import zipfile print "Processing File " + sys.argv[1] file=zipfile.ZipFile(sys.argv[1],"r");
for name in file.namelist():
utf8name=name.decode('gbk')
print "Extracting " + utf8name
pathname = os.path.dirname(utf8name)
if not os.path.exists(pathname) and pathname!= "":
os.makedirs(pathname)
data = file.read(name)
if not os.path.exists(utf8name):
fo = open(utf8name, "w")
fo.write(data)
fo.close
file.close()

3、chmod +x uzip
4、./uzip xxxx.zip

亲测有效,:)

Python脚本完美解决Linux环境解压.zip文件乱码问题的更多相关文章

  1. Ubuntu18.04 解压zip文件乱码的解决方法

    在Ubuntu的系统下解压zip文件的时候居然出现了乱码,通过查找网上的资料,解决的办法有两种 一.通过unzip行命令解压,指定字符集,由于zip格式中并没有指定编码格式,Windows下生成的zi ...

  2. Linux 下 解压zip文件出现乱码

    网上下载了一个文件,鼠标右键提取出来发现中文文件名全部乱码: 打开命令行  unzip -h  可以看到 -O 参数  制定编码解压: 比如: unzip -O CP936 xxx.zip

  3. ubuntu解压zip文件乱码问题

    我的zip文件里的内容是有中文名,也有密码,在网上找到几种解决办法只有一种可以,所以在这里记录一下: 首先是安装7zip来解压,7zip的解决办法在这里,但是无法解决我的问题,仍然有乱码问题 最后是在 ...

  4. ubuntu 解压zip 文件乱码

    用 unzip -O cp936 就可以了, 但是,有些发行版所带的 unzip 没有这个参数,比如 ArchLinux 就需要安装 unzip-iconv. Ubuntu 12.04 里面的 unz ...

  5. python用zipfile模块打包文件或是目录、解压zip文件实例

    #!/usr/bin/env python # -*- coding: utf-8 -*- from zipfile import * import zipfile #解压zip文件 def unzi ...

  6. linux 解压zip文件

    linux 解压zip文件 学习了:https://blog.csdn.net/hbcui1984/article/details/1583796 unzip xx.zip

  7. CentOS 7 使用unzip解压zip文件提示未找到命令的解决方法

    故障现象: 解决方法: 如果你使用unzip命令解压.zip文件,提示未找到命令,可能是你没有安装unzip软件,下面是安装方法 [root@localhost www]# yum install - ...

  8. 解决ubuntu解压zip文件名乱码的问题

    1. 安装7-zip 和 convmv : 命令: sudo apt-get install convmv p7zip-full 2. 解压zip文件: 命令:LANG=C 7z e yourZIPf ...

  9. AIX解压ZIP文件

    AIX系统自身是没有解压ZIP文件的,但在AIX安装oracle数据库服务器的话,在$ORACLE_HOME/bin路径下方却有unzip命令,可以解压ZIP文件. 一.shell脚本   之前的版本 ...

随机推荐

  1. mvn test 执行testng测试用例

    maven项目,把testng用例防止test目录下,配置pom.xml 文件如下,执行mvn test 能自动执行testng里面的用例 <project xmlns="http:/ ...

  2. 【转】Ubuntu VI基本用法

    转自:http://blog.sina.com.cn/s/blog_4f3b79d0010166ai.html 1.vi的基本概念 基本上vi可以分为三种状态,分别是命令模式(command mode ...

  3. Eclipse使用git最基本流程(提交远程仓库的方法)

    注册一个github账号 注册完成之后,点击右上角的settings(就是那个齿轮,设置的图标) Step6 Egit的使用 首先,登入你的github账号,点击加号,选择New repositror ...

  4. 使用配置hadoop中常用的Linux(ubuntu)命令

    生成key: $ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized ...

  5. IE兼容模式下 SCRIPT1028: 缺少标识符、字符串或数字

    例如下面一段代码 var a = { x: 1, y: 2, }; alert(a.x); 如果在IE的兼容性视图(IE7文档模式)下,会报告下面的错误: SCRIPT1028: 缺少标识符.字符串或 ...

  6. Litjson序列化

    var jsonStr = JsonMapper.ToJson(tmpType); var tmpObject = JsonMapper.ToObject<TestClass>(jsonS ...

  7. 基于PCIe的高速接口设计

    基于PCIe的高速接口设计 由 judyzhong 于 星期四, 03/03/2016 - 13:49 发表 作者:李晓宁,姚远程,秦明伟 2016年微型机与应用第1期 摘要:PCIe总线是第三代I/ ...

  8. 公共的Json操作C#类

    using System; using System.Data; using System.Text; using System.Collections.Generic; using System.R ...

  9. AI落地企业业务的一些问题

    这两年大家都在喊未来已来,软件企业不管有没有算法工程师都竖起了AI的大旗,传统企业不管现在OA现状如何都想在数据转型.智能制造.机器智能方面尝尝鲜,感觉好像和前两年的互联网+风潮有点像,最近半年我在某 ...

  10. Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...