unar万能linux解压工具

1. 安装

sudo apt-get install unar

2.列出压缩包内容

lsar test.zip

3.解压压缩包

unar test.zip

4.unar常用选项解释

-o

解释:指定解压结果保存的位置
 unar test.zip -o /home/dir/

-e

解释:指定编码
 unar -e GBK test.zip

-p

解释:指定解压密码
 unar -p 123456 test.zip

3.解决linux解压压缩包中文文件名乱码问题

lsar test.zip###若发现乱码,可指定压缩包文件名使用的编码格式##

lsar -e GB18030 test.zip###若能正常列出文件名,可解压###

unar -e GB18030 test.zip

用于php调取命令转中文方法:

安装p7zip和convmv

# ubuntu

$  sudo  apt-get install p7zip convmv

执行一下命令解压缩

# 使用7z解压缩``$ 7za x your-zip-``file``.zip

#递归转码``$ convmv -f GBK -t utf8 --notest -r .

<?php
 $commond = "LANG=C 7za x 1.zip";   
// $commond = 'unzip ./2.zip';   
system($commond,$status);   
echo $status;   $commond = "convmv -f GBK -t utf8 --notest -r .";   
system($commond,$status);  

本文转载于:http://blog.csdn.net/dk_mcu/article/details/50732703

王加文博客
请先登录后发表评论
  • latest comments
  • 总共0条评论