日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

linux bz2 xz gz,压缩介绍、bz2、gz、xz压缩工具

發布時間:2023/12/20 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux bz2 xz gz,压缩介绍、bz2、gz、xz压缩工具 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

壓縮打包介紹

常見的壓縮文件

Windows ?.rar .zip .7z

Linux gz、zip、bz2、xz、tar.gz、tar.bz2、tar.xz

壓縮對于磁盤節省空間

壓縮對于傳輸傳輸時間短,節省帶寬資源

gzip壓縮工具

gzip 1.txt

[root@lsx1 ~]# ls

anaconda-ks.cfg ?lsx.sh

[root@lsx1 ~]# gzip lsx.sh //壓縮之后源文件消失

[root@lsx1 ~]# ls //壓縮之后源文件消失

anaconda-ks.cfg ?lsx.sh.gz

gzip -d 1.txt.gz / gunzip 1.txt.gz

[root@lsx1 ~]# gzip -d lsx.sh.gz ?//解壓縮

[root@lsx1 ~]# ls ?//解壓縮之后壓縮包丟失

anaconda-ks.cfg ?lsx.sh

gzip -# 1.txt ?//#范圍2021年05月14日,默認6

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 169K 11月4 08:33 lsx.txt

[root@lsx1 ~]# gzip lsx.txt ?//默認6

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 46K 11月4 08:33 lsx.txt.gz

[root@lsx1 ~]# gzip -1 lsx.txt ?//-1 //數值越大越嚴謹

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 54K 11月4 08:33 lsx.txt.gz

不能壓縮目錄

[root@lsx1 ~]# gzip lsx ?//不能壓縮目錄

gzip: lsx is a directory -- ignored

zcat 1.txt.gz

[root@lsx1 ~]# zcat lsx.txt.gz ?//查看文件內容

gzip -c 1.txt > /root/1.txt.gz

[root@lsx1 ~]# gzip -c lsx.txt >./lsx.txt.gz ?//-c?壓縮但是源文件不消失,需指定壓縮之后文件名

unzip -c /root/1.txt.gz > /tmp/1.txt.new

[root@lsx1 ~]# gzip -dc ./lsx.txt.gz > /tmp/lsx.txt ?//解壓縮。源文件不丟,解壓之后文件需指定

[root@lsx1 ~]# ll /tmp/ -h

-rw-r--r-- 1 root root 169K 11月4 08:49 lsx.txt

bzip2壓縮工具

bzip2 1.txt ?/ bzip2 -z 1.txt

[root@lsx1 ~]# bzip2 lsx.txt ?//壓縮成bz2文件,源文件消失

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 43K 11月4 08:43 lsx.txt.bz2

-rw-r--r-- ?1 root root 46K 11月4 08:44 lsx.txt.gz

bzip2 -d 1.txt.bz2 / bunzip2 1.txt.bz2

[root@lsx1 ~]# bzip2 -d lsx.txt.bz2 ?//解壓縮壓縮包消失

[root@lsx1 ~]# ls

anaconda-ks.cfg ?lsx ?lsx.txt ?lsx.txt.gz

bzip -# 1.txt ?//#范圍2021年05月14日,默認9 ?bzip壓縮比gz嚴謹

[root@lsx1 ~]# bzip2 -1 lsx.txt

[root@lsx1 ~]# ll

-rw-r--r-- ?1 root root 45588 11月4 08:43 lsx.txt.bz2

-rw-r--r-- ?1 root root 46625 11月4 08:44 lsx.txt.gz

[root@lsx1 ~]# bzip2 -9 lsx.txt

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 43K 11月4 08:43 lsx.txt.bz2

-rw-r--r-- ?1 root root 46K 11月4 08:44 lsx.txt.gz

不能壓縮目錄

[root@lsx1 ~]# bzip2 lsx

bzip2: Input file lsx is a directory.

bzcat 1.txt.bz2

[root@lsx1 ~]# bzcat lsx.txt.bz2 //查看文件內容

bzip2 -c 1.txt > /root/1.txt.bz

[root@lsx1 ~]# bzip2 -c ./lsx.txt>./lsx.txt.bz2 ?//壓縮。源文件不消失,指定壓縮后文件

[root@lsx1 ~]# ls

lsx.txt ?lsx.txt.bz2 ?lsx.txt.gz

bzip2 -c -d /root/1.txt.bz2 > /tmp/1.txt.new2

[root@lsx1 ~]# bzip2 -dc lsx.txt.bz2 > /tmp/lsx.bzip2 ?//解壓壓縮包不消失,需指定壓縮后文件

[root@lsx1 ~]# ls /tmp/

lsx.bzip2

xz壓縮工具

xz 1.txt ?/ xz -z 1.txt

[root@lsx1 ~]# xz lsx.txt //壓縮文件

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 43K 11月4 09:10 lsx.txt.bz2

-rw-r--r-- ?1 root root 46K 11月4 08:44 lsx.txt.gz

-rw-r--r-- ?1 root root 42K 11月4 09:09 lsx.txt.xz

xz -d 1.txt.xz / unxz 1.txt.xz

[root@lsx1 ~]# xz -d lsx.txt.xz //解壓,壓縮包消失

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 169K 11月4 09:09 lsx.txt

-rw-r--r-- ?1 root root ?43K 11月4 09:10 lsx.txt.bz2

-rw-r--r-- ?1 root root ?46K 11月4 08:44 lsx.txt.gz

xz -# 1.txt ?//#范圍2021年05月14日,默認9壓縮比:xz壓縮最嚴謹,次bz2,gz

[root@lsx1 ~]# xz -9 lsx.txt

[root@lsx1 ~]# ll -h

-rw-r--r-- ?1 root root 43K 11月4 09:10 lsx.txt.bz2

-rw-r--r-- ?1 root root 46K 11月4 08:44 lsx.txt.gz

-rw-r--r-- ?1 root root 42K 11月4 09:09 lsx.txt.xz

不能壓縮目錄

[root@lsx1 ~]# xz lsx

xz: lsx: Is a directory, skipping

xzcat 1.txt.xz

[root@lsx1 ~]# xzcat lsx.txt.xz //查看文件內容

xz -c 1.txt > /root/1.txt.xz

[root@lsx1 ~]# xz -c lsx.txt>./lsx.txt.xz //壓縮。-c源文件不消失,需指定壓縮文件

[root@lsx1 ~]# ls

lsx.txt ?lsx.txt.xz

xz -d -c /root/1.txt.xz > 1.txt.new3

[root@lsx1 ~]# xz -dc lsx.txt.xz > lsx.txt.xz.new ?//解壓縮,-c指定解壓縮之后文件,壓縮包不消失

[root@lsx1 ~]# ls

lsx.txt.xz

lsx.txt.xz.new

本文轉自 蝦米的春天 51CTO博客,原文鏈接:http://blog.51cto.com/lsxme/1980533,如需轉載請自行聯系原作者

總結

以上是生活随笔為你收集整理的linux bz2 xz gz,压缩介绍、bz2、gz、xz压缩工具的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。