Home  >  Article  >  Operation and Maintenance  >  Detailed introduction to file packaging and decompression

Detailed introduction to file packaging and decompression

零下一度
零下一度Original
2017-06-27 09:19:421291browse

1. Knowledge reserve

  • Commonly used compressed files in windows:

    • *.zipzip program Pack compressed files

    • *.rar

    • ##*.7z

  • Common on Linux:

    • *.gz,*.xz,*.bz2,

    • *.tartar program packaged, uncompressed

    • *.tar.gztar packaging, gzip compression,

    • *.tar.xz,*.tar.bz2

2. Command learning

1.zip:

* 打包:zip something.zip something(目录加-r)
* 解包:unzip something
* 指定路径:-d

2.tar:

$ tar --help // 帮助中有实例
$ tar -cf shiyanlou.tar ~ // 打包
$ tar -xf shiyanlou.tar // 解包
$ tar -xf shiyanlou.tar -C tardir //解压到tardir目录 -C参数
$ tar -tf shiyanlou.tar // 仅查看包
$ tar -cphf etc.tar /etc //备份(-p 保留文件属性;-h 备份链接指向源文件)
$ 
$ tar -czf shiyanlou.tar.gz ~ // 使用gzip压缩文件
$ tar -xzf shiyanlou.tar.gz // 解压

3.rar

Install

rar and unrar

$ sudo apt-get update
$ sudo apt-get install rar unrar

rar command parameters have no -

$ rar a shiyanlou.rar // a 参数
$ rar d shiyanlou.rar .zshrc //压缩
$ rar l shiyanlou.rar .zshrc // 查看不接呀
$ unrar x shiyanlou.rar //全路径解压
$ unrar e shiyanlou.rar tmp/  //解压到指定路径

The above is the detailed content of Detailed introduction to file packaging and decompression. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn