Linux commands (18) Compress or unzip files and directories gzip Gunzip

Source: Internet
Author: User

Directory

1. Introduction to Commands

2. Common parameter Introduction

3. Example

4. Direct access to the bottom

Introduction to Commands

Like the zip command, gzip for file compression, gzip compressed file extension ". gz",gzip Delete source files after default compression . Gunzip is used to decompress files that have been compressed by gzip.

Back to Catalog

Common parameters Introduction

First, gzip commonly used parameter description
-d 对压缩文件进行解压-r 递归压缩指定目录及其子目录下的所有文件-t 检查压缩文件的完整性-v 对于每个压缩和解压缩的文档,显示相应的文件名和压缩比-l 显示压缩文件的压缩信息-num 用指定的数字 num 配置压缩比
Second, gunzip commonly used parameter description
-a 使用 ASCⅡ 文字模式-c 把解压后的文件输出到标准输出设备-f 强行解开压缩文件,不理会文件名称或硬链接是否存在以及该文件是否为符号链接-l 列出压缩文件的相关信息-L 显示版本与版权信息-n 解压缩时,若压缩文件内含有原来的文件名称及时间戳记,则将其忽略不予处理-N 解压缩时,若压缩文件内含有原来的文件名称及时间戳记,则将其回存到解开的文件上-q 不显示警告信息-r 递归处理,将指定目录下的所有文件及子目录一并处理-S 更改压缩字尾字符串-t 测试压缩文件是否正确无误-v 显示命令执行过程(?)-V 显示版本信息

Back to Catalog

Instance

1. Compress the file, the original file is deleted after compression

gzip file_back.sh

2. Compress files to keep original files

gzip -c file_back.sh  >file_back.sh.gz

3. Extracting files

gunzip file_back.shgunzip -c file_back.sh.gz  >file_back.sh

Back to Catalog

Linux commands (18) Compress or unzip files and directories gzip Gunzip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.