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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

常用归档压缩命令

發(fā)布時間:2023/11/29 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 常用归档压缩命令 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1. 打包tar

打包表示把一堆文件變成一個

tar ####打包工具

-f ####指定生成包的名字

-c ####創(chuàng)建包

-v ####顯示創(chuàng)建過程

-t ####查看包中內容

-x ####解包

-r ####添加文件到包中

--delete filename ##刪除包中指定文件

--get filename ?##取出包中指定文件

? ? ? ? ?cf

? ? ? ? ?fr

? ? ? ? ?cvf ? ?等組合使用


2. 壓縮

gzip

gzip xxxx.tar =====> xxxx.tar.gz ##壓縮

gunzip xxxx.tar.gz =====> xxxx.tar ##解壓

tar zcvf xxxx.tar.gz 目標文件 ##打包壓縮文件

tar zxvf xxxx.tar.gz ###xxxx.tar.gz===>xxxx


bz2

bzip2 xxxx.tar =====> xxxx.tar.bz2 ##壓縮

bunzip2 xxxx.tar.bz2 =====> xxxx.tar ##解壓

tar jcvf xxxx.tar.bz2 目標文件 ##打包壓縮文件

tar jxvf xxxx.tar.bz2 ###xxxx.tar.bz2===>xxxx


xz

xz xxxx.tar =====> xxxx.tar.xz ? ? ?##壓縮

unxz xxxx.tar.xz =====> xxxx.tar ? ?##解壓

tar Jcvf xxxx.tar.xz 目標文件 ? ?##打包壓縮文件

tar Jxvf xxxx.tar.xz ? ? ? ? ? ? ? ?###xxxx.tar.xz===>xxxx


zip

zip -r xxx.tar.zip xxx.tar ? ?###壓縮

unzip xxx.tar.zip ? ?###解壓


例:

1.打包文件

[root@localhost test]# touch file{1..10}

[root@localhost test]# tar -cf test.tar ?*

[root@localhost test]# ls

file1 ?file10 ?file2 ?file3 ?file4 ?file5 ?file6 ?file7 ?file8 ?file9 ?test.tar


2.解壓文件

[root@localhost test]# mkdir test1

[root@localhost test]# cd test1

[root@localhost test1]# tar xf ../test.tar?

[root@localhost test1]# ls


3.gzip打包壓縮

[root@localhost test]# ls

file1 ?file10 ?file2 ?file3 ?file4 ?file5 ?file6 ?file7 ?file8 ?file9

[root@localhost test]# tar -zcvf test.tar *

file1

file10

file2

file3

file4

file5

file6

file7

file8

file9

[root@localhost test]# ls

file1 ?file10 ?file2 ?file3 ?file4 ?file5 ?file6 ?file7 ?file8 ?file9 ?test.tar


4.解gzip壓縮包

[root@localhost test]# ls

file1 ?file10 ?file2 ?file3 ?file4 ?file5 ?file6 ?file7 ?file8 ?file9 ?test.tar

[root@localhost test]# mkdir test2

[root@localhost test]# cd test2/

[root@localhost test2]# tar -zxvf ../test.tar?

file1

file10

file2

file3

file4

file5

file6

file7

file8

file9

[root@localhost test2]# ls

file1 ?file10 ?file2 ?file3 ?file4 ?file5 ?file6 ?file7 ?file8 ?file9




轉載于:https://blog.51cto.com/willis/1846719

總結

以上是生活随笔為你收集整理的常用归档压缩命令的全部內容,希望文章能夠幫你解決所遇到的問題。

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