linux解压rar文件,linux下解压rar文件

rar是一个在windows下盛行的压缩格式,到了linux/unix环境下,却连找个解压缩的工具都很难找到。网上找了下,发现7zip可以用来解压这个。顺便记录下解决过程:

1、安装以下程序:

-rw-r--r--  1 root root     2152153 Mar 31 10:56 p7zip_9.20.1_x86_linux_bin.tar.bz2

-rw-r--r--  1 root root     3835235 Mar 31 10:56 p7zip_9.20.1_src_all.tar.bz2

2、分别解压得到:

p7zip_9.20.1目录

3、进入p7zip_9.20.1目录,安装:

[root@DB p7zip_9.20.1]# ./install.sh

- installing /usr/local/bin/7za

- installing /usr/local/bin/7zr

- installing /usr/local/bin/7z

- installing /usr/local/lib/p7zip/7zCon.sfx

- installing /usr/local/lib/p7zip/7z.so

- installing /usr/local/lib/p7zip/Codecs

- installing /usr/local/man/man1/7z.1

- installing /usr/local/man/man1/7za.1

- installing /usr/local/man/man1/7zr.1

- installing /usr/local/share/doc/p7zip/README

- installing /usr/local/share/doc/p7zip/ChangeLog

- installing HTML help in /usr/local/share/doc/p7zip/DOCS

总共有三类命令:7z 7zr 7za,作用:

7z uses plugins (7z.so and Codecs/Rar29.so) to handle archives.

7za is a stand-alone executable.

7za handles less archive formats than 7z.exe.

7zr is a light stand-alone executable that supports only 7z/LZMA/BCJ/BCJ2.

所以用7z来解压,先看下命令格式:

[root@DB p7zip_9.20.1]# 7z

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Usage: 7z [...] [...]

[]

a: Add files to archive

b: Benchmark

d: Delete files from archive

e: Extract files from archive (without using directory names)

l: List contents of archive

t: Test integrity of archive

u: Update files to archive

x: eXtract files with full paths

-ai[r[-|0]]{@listfile|!wildcard}: Include archives

-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives

-bd: Disable percentage indicator

-i[r[-|0]]{@listfile|!wildcard}: Include filenames

-m{Parameters}: set compression Method

-o{Directory}: set Output directory

-p{Password}: set Password

-r[-|0]: Recurse subdirectories

-scs{UTF-8 | WIN | DOS}: set charset for list files

-sfx[{name}]: Create SFX archive

-si[{name}]: read data from stdin

-slt: show technical information for l (List) command

-so: write data to stdout

-ssc[-]: set sensitive case mode

-t{Type}: Set type of archive

-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options

-v{Size}[b|k|m|g]: Create volumes

-w[{path}]: assign Work directory. Empty path means a temporary directory

-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames

-y: assume Yes on all queries

起先以为这么解压就行了:

7z -e xx.rar

但是报:

[oracle@DB ~]$ 7z -e wind_20120101.rar

Error:

Incorrect command line

奇怪,难道跟正常的格式不一样么?所以又回过头去仔细学习了下命令格式。

重新再来:

[oracle@DB ~]$7z e -slt wind_20120101.rar

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

p7zip Version 9.20 (locale=en_US,Utf16=on,HugeFiles=on,2 CPUs)

Processing archive: wind_20120101.rar

这下可以了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12932950/viewspace-720028/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值