Home > Article > Operation and Maintenance > Detailed introduction to file packaging and decompression
Commonly used compressed files in windows:
*.zip
zip program Pack compressed files
*.rar
##*.7z
*.gz,
*.xz,
*.bz2,
*.tartar program packaged, uncompressed
*.tar.gztar packaging, gzip compression,
*.tar.xz,
*.tar.bz2
* 打包:zip something.zip something(目录加-r) * 解包:unzip something * 指定路径:-d
$ 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 // 解压
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!