惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
T
Threatpost
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
PCI Perspectives
PCI Perspectives
T
The Exploit Database - CXSecurity.com
Y
Y Combinator Blog
雷峰网
雷峰网
爱范儿
爱范儿
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
S
Securelist
宝玉的分享
宝玉的分享
L
LangChain Blog
O
OpenAI News
AI
AI
P
Privacy International News Feed
L
LINUX DO - 最新话题
D
DataBreaches.Net
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs
罗磊的独立博客
M
MIT News - Artificial intelligence
Security Archives - TechRepublic
Security Archives - TechRepublic
月光博客
月光博客
博客园 - 【当耐特】
T
Tailwind CSS Blog
C
Cybersecurity and Infrastructure Security Agency CISA
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
Jina AI
Jina AI
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
Webroot Blog
Webroot Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog

博客园 - 曹立松

HK-EOST 智慧运维监管终端机介绍 HK-IOST 智慧运维监管终端机介绍 酸梅汤 HK2000-如何修改数采IP以及网关等 详细的568A和568B线序 H2000LCDKey键盘操作说明 H2000Config配置数采 用批处理(.BAT)自动设置计算机名IP地址DNS - 曹立松 - 博客园 HK-2000 数采仪系统说明之 7.HK7710 DTU 简单配置说明 HK-2000 数采仪 问题解答 - 曹立松 HK-2000 数采仪系统说明之 6.应用程序更新 Linux 服务器方式 - 曹立松 HK-2000 数采仪系统说明之 5.H2000SService程序调用说明 HK-2000 数采仪系统说明之 4.系统程序监控功能说明 HK-2000 数采仪系统说明之 3.数采应用程序目录说明 HK-2000 数采仪系统说明之 2.系统启动过程说明 HK-2000 数采仪系统说明之 1.系统启动日志 HK-2000 数采仪 航空头接口定义 HK2000 V2版本 GPRS通讯串口说明 CMWAP和CMNET的区别
linux gzip 命令详解
曹立松 · 2010-05-28 · via 博客园 - 曹立松

压缩文件大小有两个明显的好处,一是可以减少存储空间,二是通过网络传输文件时,可以减少传输的时间。

gzip是在Linux系统中经常使用的一个对文件进行压缩和解压缩的命令,既方便又好用。

语法:gzip [选项] 压缩(解压缩)的文件名

各选项的含义:

-c 将输出写到标准输出上,并保留原有文件。

-d 将压缩文件解压。

-l 对每个压缩文件,显示下列字段: 压缩文件的大小 未压缩文件的大小 压缩比 未压缩文件的名字

-r 递归式地查找指定目录并压缩其中的所有文件或者是解压缩。

-t 测试,检查压缩文件是否完整。

-v 对每一个压缩和解压的文件,显示文件名和压缩比。

-num 用指定的数字num调整压缩的速度,

-1或--fast表示最快压缩方法(低压缩比),

-9或--best表示最慢压缩方法(高压缩比)。系统缺省值为6。

假设一个目录/home下有文件mm.txt、sort.txt、xx.com。

例1:把/home目录下的每个文件压缩成.gz文件。

$ cd /home

$ gzip *

$ ls m.txt.gz sort.txt.gz xx.com.gz

例2:把例1中每个压缩的文件解压,并列出详细的信息。

$ gzip -dv *

mm.txt.gz 43.1%-----replaced with mm.txt

sort.txt.gz 43.1%-----replaced with sort.txt

xx.com.gz 43.1%-----replaced with xx.com

$ ls

mm.txt sort.txt xx.com

例3:详细显示例1中每个压缩的文件的信息,并不解压。

$ gzip -l *

compressed uncompr. ratio uncompressed_name 277 445 43.1% mm.txt 278 445 43.1% sort.txt 277 445 43.1% xx.com

$ ls mm.txt.gz sort.txt.gz xx.com.gz

例4:压缩一个tar备份文件,如usr.tar,此时压缩文件的扩展名为.tar.gz

$ gzip usr.tar

$ ls

usr.tar.gz