首页
/
每日頭條
/
生活
/
linux解壓zip命令行
linux解壓zip命令行
更新时间:2024-04-28 01:02:53

linux解壓zip命令行?二、快速使用1. tar 命令,接下來我們就來聊聊關于linux解壓zip命令行?以下内容大家不妨參考一二希望能幫到您!

linux解壓zip命令行(Linux命令之解壓縮tarzip)1

linux解壓zip命令行

二、快速使用

1. tar 命令

語法: tar [主選項 輔選項] 文件或目錄

示例:

  1. # 壓縮文件 file1 和目錄 dir2 到 test.tar.gz
  2. tar -zcvf test.tar.gz file1 dir2
  3. # 解壓 test.tar.gz(将 c 換成 x 即可)
  4. tar -zxvf test.tar.gz
  5. # 列出壓縮文件的内容
  6. tar -ztvf test.tar.gz

釋義:

-z : 使用 gzip 來壓縮和解壓文件

-v : --verbose 詳細的列出處理的文件

-f : --file=ARCHIVE 使用檔案文件或設備,這個選項通常是必選的

-c : --create 創建一個新的歸檔(壓縮包)

-x : 從壓縮包中解出文件

其它:

tar 命令其實并不是真的解壓縮的處理者,而是使用了 gzip 或者 bzip2 等其它命令來達成,但是 gzip 等命令通常隻能處理單個文件,并不方便,所以一般我們都是選擇使用 tar 命令間接的完成解壓縮。

2. rar 命令

示例:

  1. # 壓縮文件
  2. rar a -r test.rar file
  3. # 解壓文件
  4. unrar x test.rar

釋義:

a : 添加到壓縮文件

-r : 遞歸處理

x : 以絕對路徑解壓文件

3. zip 命令

示例:

  1. # 壓縮文件
  2. zip -r test.zip file
  3. # 解壓文件
  4. zip test.zip

釋義:

-r : 遞歸處理

三、tar 命令詳解

1. 語法:

tar [-ABcdgGhiklmMoOpPrRsStuUvwWxzZ][-b <區塊數目>][-C <目的目錄>][-f <備份文件>][-F <Script文件>][-K <文件>][-L <媒體容量>][-N <日期時間>][-T <範本文件>][-V <卷冊名稱>][-X <範本文件>][-<設備編号><存儲密度>][--after-date=<日期時間>][--atime-preserve][--backuup=<備份方式>][--checkpoint][--concatenate][--confirmation][--delete][--exclude=<範本樣式>][--force-local][--group=<群組名稱>][--help][--ignore-failed-read][--new-volume-script=<Script文件>][--newer-mtime][--no-recursion][--null][--numeric-owner][--owner=<用戶名稱>][--posix][--erve][--preserve-order][--preserve-permissions][--record-size=<區塊數目>][--recursive-unlink][--remove-files][--rsh-command=<執行指令>][--same-owner][--suffix=<備份字尾字符串>][--totals][--use-compress-program=<執行指令>][--version][--volno-file=<編号文件>][文件或目錄...]

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2024 - www.tftnews.com All Rights Reserved