linux gzip命令

 

 

文件命令15: gzip
gzip是在Linux系统中经常使用的一个对文件进行压缩和解压缩的命令。
gzip不仅可以用来压缩大的、较少使用的文件以节省磁盘空间。
语法:gzip[参数][文件或者目录]
-d或--decompress或----uncompress 解开压缩文件。
-f或--force 强行压缩文件,不理会文件名是否存在以及该文件是否为符号连接。
-l或--list 列出压缩文件的相关信息。
-r或--recursive 递归处理,将指定目录下的所有文件及子目录一并处理。
v或--verbose 显示指令执行过程。

 

 

[root@localhost tesst]# touch 1.txt
[root@localhost tesst]# ll
total 0
-rw-r--r--. 1 root root 0 Nov 11 01:20 1.txt
[root@localhost tesst]# gzip 1.txt 
[root@localhost tesst]# ll
total 4
-rw-r--r--. 1 root root 26 Nov 11 01:20 1.txt.gz


[root@localhost tesst]# gzip -d 1.txt.gz 
[root@localhost tesst]# ll
total 0
-rw-r--r--. 1 root root 0 Nov 11 01:20 1.txt

 

 

 

posted @ 2023-11-11 01:18  minger_lcm  阅读(20)  评论(0编辑  收藏  举报