linux 解压缩
file.tar.gz和file.tar.bz2格式的解包命令如下;
[root@localhost ]# tar jxvf file.tar.bz2
[root@localhost ]# tar zxvf file.tar.gz
解压文件tgz
例如文件名为: yyyy.tgz
先使用GZIP解压为TAR文件
gzip -dv yyyy.tgz
同时解压后生成yyyy.tar文件
再使用tar解压yyyy.tar文件
tar xvf yyyy.tar
解压下边的命令:
gzip -dv R220-ESiVision-WebEnv-X86-Linux.tgz
tar xvf R220-ESiVision-WebEnv-X86-Linux.tar
压缩:tgz文件。
tar -czvf R220-ESiVision-WebEnv-X86-Linux.tgz apache-tomcat-5.5.23 jdk1.5.0_12 net-snmp-5.1.1
tar -czvf filename.tgz file
把/home/kankan/shopstyleTest/code/data/feed/nuan_jp/下nuan_jp.xml和所有图片都打包成tgz:
tar -czvf nuan_jp.tgz /home/kankan/shopstyleTest/code/data/feed/nuan_jp/*
Install unrar command
Under Debian or Ubuntu Linux, you need to type apt-get command as follows to install unrar program:
# apt-get install unrar
If you are using Fedora core Linux / CentOS / RHEL, use yum command as follows (see discussion below for more):
# yum install unrar
If you are using FreeBSD, enter:
# pkg_add -v -r unrar
If any of above, methods is not working for you, download binary package from official rarlab site:
$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
Next, untar file, enter:
$ tar -zxvf rarlinux-3.6.0.tar.gz
Both unrar and rar commands are located in rar sub-directory. Just cd to rar directory, type:
$ cd rar
$ ./unrar
Now copy rar and unrar file to /bin directory, type:
# cp rar unrar /bin
HowTo: Use unrar Command
The unrar command supports various options, below are common options that you need to for extracting files.
Task: Exreact rar (unpack) File
To extract file.rar file into the current directory, enter:
$ unrar e file.rar
Task: List (l) file inside rar archive:
$ unrar l file.rar
Task: To extract (x) files with full path type command:
$ unrar x file.rar
(D) To test (t) integrity of archive, file type command:
$ unrar t file.rar
浙公网安备 33010602011771号