List of common decompress & compress tools in unix

For my future reference:  (整理自互联网)

check folder size:

du -sh *

————

1. 7-zip:  (.7z file)

官网下载地址:http://www.7-zip.org/download.html
源文件项目地址:http://sourceforge.net/projects/p7zip/,目前最新版为9.20.1。
执行以下命令下载安装:

wget http://nchc.dl.sourceforge.net/project/p7zip/p7zip/9.20.1/p7zip_9.20.1_src_all.tar.bz2
tar -jxvf p7zip_9.20.1_src_all.tar.bz2
cd p7zip_9.20.1
make
make install

使用7zip的命令是7za。
安装完成后的使用方法:
7za {a|d|l|e|u|x} 压缩包文件名 {文件列表或目录,可选}

a 向压缩包里添加文件或创建压缩包,如向001.7z添加001.jpg,执行:7za a 001.7z 001.jpg;将001目录打包执行:7za a 001.7z 001;
d 从压缩里删除文件,如将001.7z里的001.jpg删除,执行:7za d 001.7z 001.jpg
l 列出压缩包里的文件,如列出001.7z里的文件,执行:7za l 001.7z
e 解压到当前目录,目录结构会被破坏,如001.rar内有如下目录及文件123/456/789.html,
执行:7za e 001.rar,目录123和456及文件789.html都会存放在当前目录下。
x 以完整路径解压。

zip文件解压中文文件乱码问题,由于zip文件中没有声明其编码,所以在Linux上使用unzip解压以默认编码解压,中文文件名会出现乱码。

————–

2. tar:  (decompress)

  1. Type at the command prompt
    tar xvzf file-1.0.tar.gz – to uncompress a gzip tar file (.tgz or .tar.gz)
    tar xvjf file-1.0.tar.bz2 – to uncompress a bzip2 tar file (.tbz or .tar.bz2)
    tar xvf file-1.0.tar – to uncompressed tar file (.tar)
    • x = eXtract, this indicated an extraction c = create to create )
    • v = verbose (optional) the files with relative locations will be displayed.
    • z = gzip-ped; j = bzip2-zipped
    • f = from/to file … (what is next after the f is the archive file)
  2. The files will be extracted in the current folder (most of the times in a folder with the name ‘file-1.0’).

Continue reading List of common decompress & compress tools in unix