tar,是Linux系統的一個命令,非常好用!如果你對tar命令不甚了解的話,可以看看小編為大家整理的tar壓縮解壓縮命令詳解。

tar:
-c: 建立壓縮檔案
-x:解壓
-t:查看內容
-r:向壓縮歸檔文件末尾追加文件
-u:更新原壓縮包中的文件
這五個是獨立的命令,壓縮解壓都要用到其中一個,可以和別的命令連用但只能用其中一個。下面的參數是根據需要在壓縮或解壓檔案時可選的。
-z:有gzip屬性的
-j:有bz2屬性的
-Z:有compress屬性的
-v:顯示所有過程
-O:將文件解開到標準輸出
下面的參數-f是必須的
-f: 使用檔案名字,切記,這個參數是最后一個參數,后面只能接檔案名。
# tar -cf all.tar *.jpg
這條命令是將所有.jpg的文件打成一個名為all.tar的包。-c是表示產生新的包,-f指定包的文件名。
# tar -rf all.tar *.gif
這條命令是將所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。
# tar -uf all.tar logo.gif
這條命令是更新原來tar包all.tar中logo.gif文件,-u是表示更新文件的意思。
# tar -tf all.tar
這條命令是列出all.tar包中所有文件,-t是列出文件的意思
# tar -xf all.tar
這條命令是解出all.tar包中所有文件,-t是解開的意思
壓縮:
tar -cvf jpg.tar *.jpg //將目錄里所有jpg文件打包成tar.jpg
tar -czf jpg.tar.gz *.jpg //將目錄里所有jpg文件打包成jpg.tar后,并且將其用gzip壓縮,生成一個gzip壓縮過的包,命名為jpg.tar.gz
tar -cjf jpg.tar.bz2 *.jpg //將目錄里所有jpg文件打包成jpg.tar后,并且將其用bzip2壓縮,生成一個bzip2壓縮過的包,命名為jpg.tar.bz2
tar -cZf jpg.tar.Z *.jpg //將目錄里所有jpg文件打包成jpg.tar后,并且將其用compress壓縮,生成一個umcompress壓縮過的包,命名為jpg.tar.Z
rar a jpg.rar *.jpg //rar格式的壓縮,需要先下載rar for linux
zip jpg.zip *.jpg //zip格式的壓縮,需要先下載zip for linux
解壓:
tar -xvf file.tar //解壓 tar包
tar -xzvf file.tar.gz //解壓tar.gz
tar -xjvf file.tar.bz2 //解壓 tar.bz2
tar -xZvf file.tar.Z //解壓tar.Z
unrar e file.rar //解壓rar
unzip file.zip //解壓zip
總結:
1、*.tar 用 tar -xvf 解壓
2、*.gz 用 gzip -d或者gunzip 解壓
3、*.tar.gz和*.tgz 用 tar -xzf 解壓
4、*.bz2 用 bzip2 -d或者用bunzip2 解壓
5、*.tar.bz2用tar -xjf 解壓
6、*.Z 用 uncompress 解壓
7、*.tar.Z 用tar -xZf 解壓
8、*.rar 用 unrar e解壓
9、*.zip 用 unzip 解壓
解壓jdk到指定文件夾:
tar -xzvf jdk-8u131-linux-x64.tar.gz -C /usr/local/java
- 01root@ubuntu:~# tar --help
- 02用法: tar [選項...] [FILE]...
- 03GNU 'tar' saves many files together into a single tape or disk archive, and can
- 04restore individual files from the archive.
- 05Examples:
- 06tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.
- 07tar -tvf archive.tar # List all files in archive.tar verbosely.
- 08tar -xf archive.tar # Extract all files from archive.tar.
- 09主操作模式:
- 10-A, --catenate, --concatenate 追加 tar 文件至歸檔
- 11-c, --create 創建一個新歸檔
- 12-d, --diff, --compare 找出歸檔和文件系統的差異
- 13--delete 從歸檔(非磁帶!)中刪除
- 14-r, --append 追加文件至歸檔結尾
- 15-t, --list 列出歸檔內容
- 16--test-label 測試歸檔卷標并退出
- 17-u, --update 僅追加比歸檔中副本更新的文件
- 18-x, --extract, --get 從歸檔中解出文件
- 19操作修飾符:
- 20--check-device 當創建增量歸檔時檢查設備號(默認)
- 21-g, --listed-incremental=FILE 處理新式的 GNU 格式的增量備份
- 22-G, --incremental 處理老式的 GNU 格式的增量備份
- 23--ignore-failed-read
- 24當遇上不可讀文件時不要以非零值退出
- 25--level=NUMBER 所創建的增量列表歸檔的輸出級別
- 26-n, --seek 歸檔可檢索
- 27--no-check-device 當創建增量歸檔時不要檢查設備號
- 28--no-seek 歸檔不可檢索
- 29--occurrence[=NUMBER] 僅處理歸檔中每個文件的第 NUMBER
- 30個事件;僅當與以下子命令 --delete,
- 31--diff, --extract 或是 --list
- 32中的一個聯合使用時,此選項才有效。而且不管文件列表是以命令行形式給出或是通過
- 33-T 選項指定的;NUMBER 值默認為 1
- 34--sparse-version=MAJOR[.MINOR]
- 35設置所用的離散格式版本(隱含
- 36--sparse)
- 37-S, --sparse 高效處理離散文件
- 38重寫控制:
- 39-k, --keep-old-files don't replace existing files when extracting,
- 40treat them as errors
- 41--keep-directory-symlink preserve existing symlinks to directories when
- 42extracting
- 43--keep-newer-files
- 44不要替換比歸檔中副本更新的已存在的文件
- 45--no-overwrite-dir 保留已存在目錄的元數據
- 46--one-top-level[=DIR] create a subdirectory to avoid having loose files
- 47extracted
- 48--overwrite 解壓時重寫存在的文件
- 49--overwrite-dir 解壓時重寫已存在目錄的元數據(默認)
- 50--recursive-unlink 解壓目錄之前先清除目錄層次
- 51--remove-files 在添加文件至歸檔后刪除它們
- 52--skip-old-files don't replace existing files when extracting,
- 53silently skip over them
- 54-U, --unlink-first 在解壓要重寫的文件之前先刪除它們
- 55-W, --verify 在寫入以后嘗試校驗歸檔
- 56選擇輸出流:
- 57--ignore-command-error 忽略子進程的退出代碼
- 58--no-ignore-command-error
- 59將子進程的非零退出代碼認為發生錯誤
- 60-O, --to-stdout 解壓文件至標準輸出
- 61--to-command=COMMAND
- 62將解壓的文件通過管道傳送至另一個程序
- 63操作文件屬性:
- 64--atime-preserve[=METHOD]
- 65在輸出的文件上保留訪問時間,要么通過在讀取(默認
- 66METHOD=‘replace’)后還原時間,要不就不要在第一次(METHOD=‘system’)設置時間
- 67--clamp-mtime only set time when the file is more recent than
- 68what was given with --mtime
- 69--delay-directory-restore
- 70直到解壓結束才設置修改時間和所解目錄的權限
- 71--group=名稱 強制將 NAME
- 72作為所添加的文件的組所有者
- 73--mode=CHANGES 強制將所添加的文件(符號)更改為權限
- 74CHANGES
- 75--mtime=DATE-OR-FILE 從 DATE-OR-FILE 中為添加的文件設置
- 76mtime
- 77-m, --touch 不要解壓文件的修改時間
- 78--no-delay-directory-restore
- 79取消 --delay-directory-restore 選項的效果
- 80--no-same-owner
- 81將文件解壓為您所有(普通用戶默認此項)
- 82--no-same-permissions
- 83從歸檔中解壓權限時使用用戶的掩碼位(默認為普通用戶服務)
- 84--numeric-owner 總是以數字代表用戶/組的名稱
- 85--owner=名稱 強制將 NAME
- 86作為所添加的文件的所有者
- 87-p, --preserve-permissions, --same-permissions
- 88解壓文件權限信息(默認只為超級用戶服務)
- 89--preserve 與 -p 和 -s 一樣
- 90--same-owner
- 91嘗試解壓時保持所有者關系一致(超級用戶默認此項)
- 92-s, --preserve-order, --same-order
- 93member arguments are listed in the same order as
- 94the files in the archive
- 95--sort=ORDER directory sorting order: none (default), name or
- 96inode
- 97Handling of extended file attributes:
- 98--acls Enable the POSIX ACLs support
- 99--no-acls Disable the POSIX ACLs support
- 100--no-selinux Disable the SELinux context support
- 101--no-xattrs Disable extended attributes support
- 102--selinux Enable the SELinux context support
- 103--xattrs Enable extended attributes support
- 104--xattrs-exclude=MASK specify the exclude pattern for xattr keys
- 105--xattrs-include=MASK specify the include pattern for xattr keys
- 106設備選擇和切換:
- 107-f, --file=ARCHIVE 使用歸檔文件或 ARCHIVE 設備
- 108--force-local
- 109即使歸檔文件存在副本還是把它認為是本地歸檔
- 110-F, --info-script=名稱, --new-volume-script=名稱
- 111在每卷磁帶最后運行腳本(隱含 -M)
- 112-L, --tape-length=NUMBER 寫入 NUMBER × 1024 字節后更換磁帶
- 113-M, --multi-volume 創建/列出/解壓多卷歸檔文件
- 114--rmt-command=COMMAND 使用指定的 rmt COMMAND 代替 rmt
- 115--rsh-command=COMMAND 使用遠程 COMMAND 代替 rsh
- 116--volno-file=FILE 使用/更新 FILE 中的卷數
- 117設備分塊:
- 118-b, --blocking-factor=BLOCKS 每個記錄 BLOCKS x 512 字節
- 119-B, --read-full-records 讀取時重新分塊(只對 4.2BSD 管道有效)
- 120-i, --ignore-zeros 忽略歸檔中的零字節塊(即文件結尾)
- 121--record-size=NUMBER 每個記錄的字節數 NUMBER,乘以 512
- 122選擇歸檔格式:
- 123-H, --format=FORMAT 創建指定格式的歸檔
- 124FORMAT 是以下格式中的一種:
- 125gnu GNU tar 1.13.x 格式
- 126oldgnu GNU 格式 as per tar <= 1.12
- 127pax POSIX 1003.1-2001 (pax) 格式
- 128posix 等同于 pax
- 129ustar POSIX 1003.1-1988 (ustar) 格式
- 130v7 old V7 tar 格式
- 131--old-archive, --portability
- 132等同于 --format=v7
- 133--pax-option=關鍵字[[:]=值][,關鍵字[[:]=值]]...
- 134控制 pax 關鍵字
- 135--posix 等同于 --format=posix
- 136-V, --label=TEXT 創建帶有卷名 TEXT
- 137的歸檔;在列出/解壓時,使用 TEXT
- 138作為卷名的模式串
- 139壓縮選項:
- 140-a, --auto-compress 使用歸檔后綴名來決定壓縮程序
- 141-I, --use-compress-program=PROG
- 142通過 PROG 過濾(必須是能接受 -d
- 143選項的程序)
- 144-j, --bzip2 通過 bzip2 過濾歸檔
- 145-J, --xz 通過 xz 過濾歸檔
- 146--lzip 通過 lzip 過濾歸檔
- 147--lzma 通過 xz 過濾歸檔
- 148--lzop 通過 xz 過濾歸檔
- 149--no-auto-compress 不使用歸檔后綴名來決定壓縮程序
- 150-z, --gzip, --gunzip, --ungzip 通過 gzip 過濾歸檔
- 151-Z, --compress, --uncompress 通過 compress 過濾歸檔
- 152本地文件選擇:
- 153--add-file=FILE 添加指定的 FILE 至歸檔(如果名字以 -
- 154開始會很有用的)
- 155--backup[=CONTROL] 在刪除前備份,選擇 CONTROL 版本
- 156-C, --directory=DIR 改變至目錄 DIR
- 157--exclude=PATTERN 排除以 PATTERN 指定的文件
- 158--exclude-backups 排除備份和鎖文件
- 159--exclude-caches 除標識文件本身外,排除包含
- 160CACHEDIR.TAG 的目錄中的內容
- 161--exclude-caches-all 排除包含 CACHEDIR.TAG 的目錄
- 162--exclude-caches-under 排除包含 CACHEDIR.TAG
- 163的目錄中所有內容
- 164--exclude-ignore=FILE read exclude patterns for each directory from
- 165FILE, if it exists
- 166--exclude-ignore-recursive=FILE
- 167read exclude patterns for each directory and its
- 168subdirectories from FILE, if it exists
- 169--exclude-tag=FILE 除 FILE 自身外,排除包含 FILE
- 170的目錄中的內容
- 171--exclude-tag-all=FILE 排除包含 FILE 的目錄
- 172--exclude-tag-under=FILE 排除包含 FILE 的目錄中的所有內容
- 173--exclude-vcs 排除版本控制系統目錄
- 174--exclude-vcs-ignores read exclude patterns from the VCS ignore files
- 175-h, --dereference
- 176跟蹤符號鏈接;將它們所指向的文件歸檔并輸出
- 177--hard-dereference
- 178跟蹤硬鏈接;將它們所指向的文件歸檔并輸出
- 179-K, --starting-file=MEMBER-NAME
- 180begin at member MEMBER-NAME when reading the
- 181archive
- 182--newer-mtime=DATE 當只有數據改變時比較數據和時間
- 183--no-null 禁用上一次的效果 --null 選項
- 184--no-recursion 避免目錄中的自動降級
- 185--no-unquote do not unquote input file or member names
- 186--null -T 讀取以空終止的名字,-C 禁用
- 187-N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE
- 188只保存比 DATE-OR-FILE 更新的文件
- 189--one-file-system 創建歸檔時保存在本地文件系統中
- 190-P, --absolute-names don't strip leading '/'s from file names
- 191--recursion 目錄遞歸(默認)
- 192--suffix=STRING 在刪除前備份,除非被環境變量
- 193SIMPLE_BACKUP_SUFFIX
- 194覆蓋,否則覆蓋常用后綴(‘’)
- 195-T, --files-from=FILE 從 FILE
- 196中獲取文件名來解壓或創建文件
- 197--unquote unquote input file or member names (default)
- 198-X, --exclude-from=FILE 排除 FILE 中列出的模式串
- 199文件名變換:
- 200--strip-components=NUMBER 解壓時從文件名中清除 NUMBER
- 201個引導部分
- 202--transform=EXPRESSION, --xform=EXPRESSION
- 203使用 sed 代替 EXPRESSION
- 204來進行文件名變換
- 205文件名匹配選項(同時影響排除和包括模式串):
- 206--anchored 模式串匹配文件名頭部
- 207--ignore-case 忽略大小寫
- 208--no-anchored patterns match after any '/' (default for
- 209exclusion)
- 210--no-ignore-case 匹配大小寫(默認)
- 211--no-wildcards 逐字匹配字符串
- 212--no-wildcards-match-slash wildcards do not match '/'
- 213--wildcards 使用通配符(默認對 exclusion )
- 214--wildcards-match-slash wildcards match '/' (default for exclusion)
- 215提示性輸出:
- 216--checkpoint[=NUMBER] 每隔 NUMBER
- 217個記錄顯示進度信息(默認為 10 個)
- 218--checkpoint-action=ACTION 在每個檢查點上執行 ACTION
- 219--full-time 按文件原本時間格式打印
- 220--index-file=FILE 將詳細輸出發送至 FILE
- 221-l, --check-links
- 222只要不是所有鏈接都被輸出就打印信息
- 223--no-quote-chars=STRING 禁用來自 STRING 的字符引用
- 224--quote-chars=STRING 來自 STRING 的額外的引用字符
- 225--quoting-style=STYLE 設置名稱引用風格;有效的 STYLE
- 226值請參閱以下說明
- 227-R, --block-number 每個信息都顯示歸檔內的塊數
- 228--show-defaults 顯示 tar 默認選項
- 229--show-omitted-dirs
- 230列表或解壓時,列出每個不匹配查找標準的目錄
- 231--show-snapshot-field-ranges
- 232show valid ranges for snapshot-file fields
- 233--show-transformed-names, --show-stored-names
- 234顯示變換后的文件名或歸檔名
- 235--totals[=SIGNAL] 處理歸檔后打印出總字節數;當此
- 236SIGNAL 被觸發時帶參數 -
- 237打印總字節數;允許的信號為:
- 238SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和
- 239SIGUSR2;同時也接受不帶 SIG
- 240前綴的信號名稱
- 241--utc 以 UTC 格式打印文件修改時間
- 242-v, --verbose 詳細地列出處理的文件
- 243--warning=KEYWORD 警告控制:
- 244-w, --interactive, --confirmation
- 245每次操作都要求確認
- 246兼容性選項:
- 247-o 創建歸檔時,相當于
- 248--old-archive;展開歸檔時,相當于
- 249--no-same-owner
- 250其它選項:
- 251-?, --help 顯示此幫助列表
- 252--restrict 禁用某些潛在的有危險的選項
- 253--usage 顯示簡短的用法說明
- 254--version 打印程序版本
- 255長選項和相應短選項具有相同的強制參數或可選參數。
- 256The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
- 257The version control may be set with --backup or VERSION_CONTROL, values are:
- 258none, off never make backups
- 259t, numbered make numbered backups
- 260nil, existing numbered if numbered backups exist, simple otherwise
- 261never, simple always make simple backups
- 262--quoting-style 選項的有效參數為:
- 263literal
- 264shell
- 265shell-always
- 266c
- 267c-maybe
- 268escape
- 269locale
- 270clocale
- 271此 tar 默認為:
- 272--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/lib/tar/rmt
- 273--rsh-command=/usr/bin/rsh
- 274將錯誤報告發送到 。
復制代碼root@ubuntu:~# tar --help用法: tar [選項...] [FILE]...GNU 'tar' saves many files together into a single tape or disk archive, and canrestore individual files from the archive.Examples:tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.tar -tvf archive.tar # List all files in archive.tar verbosely.tar -xf archive.tar # Extract all files from archive.tar.主操作模式:-A, --catenate, --concatenate 追加 tar 文件至歸檔-c, --create 創建一個新歸檔-d, --diff, --compare 找出歸檔和文件系統的差異--delete 從歸檔(非磁帶!)中刪除-r, --append 追加文件至歸檔結尾-t, --list 列出歸檔內容--test-label 測試歸檔卷標并退出-u, --update 僅追加比歸檔中副本更新的文件-x, --extract, --get 從歸檔中解出文件操作修飾符:--check-device 當創建增量歸檔時檢查設備號(默認)-g, --listed-incremental=FILE 處理新式的 GNU 格式的增量備份-G, --incremental 處理老式的 GNU 格式的增量備份--ignore-failed-read當遇上不可讀文件時不要以非零值退出--level=NUMBER 所創建的增量列表歸檔的輸出級別-n, --seek 歸檔可檢索--no-check-device 當創建增量歸檔時不要檢查設備號--no-seek 歸檔不可檢索--occurrence[=NUMBER] 僅處理歸檔中每個文件的第 NUMBER個事件;僅當與以下子命令 --delete,--diff, --extract 或是 --list中的一個聯合使用時,此選項才有效。而且不管文件列表是以命令行形式給出或是通過-T 選項指定的;NUMBER 值默認為 1--sparse-version=MAJOR[.MINOR]設置所用的離散格式版本(隱含--sparse)-S, --sparse 高效處理離散文件重寫控制:-k, --keep-old-files don't replace existing files when extracting,treat them as errors--keep-directory-symlink preserve existing symlinks to directories whenextracting--keep-newer-files不要替換比歸檔中副本更新的已存在的文件--no-overwrite-dir 保留已存在目錄的元數據--one-top-level[=DIR] create a subdirectory to avoid having loose filesextracted--overwrite 解壓時重寫存在的文件--overwrite-dir 解壓時重寫已存在目錄的元數據(默認)--recursive-unlink 解壓目錄之前先清除目錄層次--remove-files 在添加文件至歸檔后刪除它們--skip-old-files don't replace existing files when extracting,silently skip over them-U, --unlink-first 在解壓要重寫的文件之前先刪除它們-W, --verify 在寫入以后嘗試校驗歸檔選擇輸出流:--ignore-command-error 忽略子進程的退出代碼--no-ignore-command-error將子進程的非零退出代碼認為發生錯誤-O, --to-stdout 解壓文件至標準輸出--to-command=COMMAND將解壓的文件通過管道傳送至另一個程序操作文件屬性:--atime-preserve[=METHOD]在輸出的文件上保留訪問時間,要么通過在讀取(默認METHOD=‘replace’)后還原時間,要不就不要在第一次(METHOD=‘system’)設置時間--clamp-mtime only set time when the file is more recent thanwhat was given with --mtime--delay-directory-restore直到解壓結束才設置修改時間和所解目錄的權限--group=名稱 強制將 NAME作為所添加的文件的組所有者--mode=CHANGES 強制將所添加的文件(符號)更改為權限CHANGES--mtime=DATE-OR-FILE 從 DATE-OR-FILE 中為添加的文件設置mtime-m, --touch 不要解壓文件的修改時間--no-delay-directory-restore取消 --delay-directory-restore 選項的效果--no-same-owner將文件解壓為您所有(普通用戶默認此項)--no-same-permissions從歸檔中解壓權限時使用用戶的掩碼位(默認為普通用戶服務)--numeric-owner 總是以數字代表用戶/組的名稱--owner=名稱 強制將 NAME作為所添加的文件的所有者-p, --preserve-permissions, --same-permissions解壓文件權限信息(默認只為超級用戶服務)--preserve 與 -p 和 -s 一樣--same-owner嘗試解壓時保持所有者關系一致(超級用戶默認此項)-s, --preserve-order, --same-ordermember arguments are listed in the same order asthe files in the archive--sort=ORDER directory sorting order: none (default), name orinodeHandling of extended file attributes:--acls Enable the POSIX ACLs support--no-acls Disable the POSIX ACLs support--no-selinux Disable the SELinux context support--no-xattrs Disable extended attributes support--selinux Enable the SELinux context support--xattrs Enable extended attributes support--xattrs-exclude=MASK specify the exclude pattern for xattr keys--xattrs-include=MASK specify the include pattern for xattr keys設備選擇和切換:-f, --file=ARCHIVE 使用歸檔文件或 ARCHIVE 設備--force-local即使歸檔文件存在副本還是把它認為是本地歸檔-F, --info-script=名稱, --new-volume-script=名稱在每卷磁帶最后運行腳本(隱含 -M)-L, --tape-length=NUMBER 寫入 NUMBER × 1024 字節后更換磁帶-M, --multi-volume 創建/列出/解壓多卷歸檔文件--rmt-command=COMMAND 使用指定的 rmt COMMAND 代替 rmt--rsh-command=COMMAND 使用遠程 COMMAND 代替 rsh--volno-file=FILE 使用/更新 FILE 中的卷數設備分塊:-b, --blocking-factor=BLOCKS 每個記錄 BLOCKS x 512 字節-B, --read-full-records 讀取時重新分塊(只對 4.2BSD 管道有效)-i, --ignore-zeros 忽略歸檔中的零字節塊(即文件結尾)--record-size=NUMBER 每個記錄的字節數 NUMBER,乘以 512選擇歸檔格式:-H, --format=FORMAT 創建指定格式的歸檔FORMAT 是以下格式中的一種:gnu GNU tar 1.13.x 格式oldgnu GNU 格式 as per tar <= 1.12pax POSIX 1003.1-2001 (pax) 格式posix 等同于 paxustar POSIX 1003.1-1988 (ustar) 格式v7 old V7 tar 格式--old-archive, --portability等同于 --format=v7--pax-option=關鍵字[[:]=值][,關鍵字[[:]=值]]...控制 pax 關鍵字--posix 等同于 --format=posix-V, --label=TEXT 創建帶有卷名 TEXT的歸檔;在列出/解壓時,使用 TEXT作為卷名的模式串壓縮選項:-a, --auto-compress 使用歸檔后綴名來決定壓縮程序-I, --use-compress-program=PROG通過 PROG 過濾(必須是能接受 -d選項的程序)-j, --bzip2 通過 bzip2 過濾歸檔-J, --xz 通過 xz 過濾歸檔--lzip 通過 lzip 過濾歸檔--lzma 通過 xz 過濾歸檔--lzop 通過 xz 過濾歸檔--no-auto-compress 不使用歸檔后綴名來決定壓縮程序-z, --gzip, --gunzip, --ungzip 通過 gzip 過濾歸檔-Z, --compress, --uncompress 通過 compress 過濾歸檔本地文件選擇:--add-file=FILE 添加指定的 FILE 至歸檔(如果名字以 -開始會很有用的)--backup[=CONTROL] 在刪除前備份,選擇 CONTROL 版本-C, --directory=DIR 改變至目錄 DIR--exclude=PATTERN 排除以 PATTERN 指定的文件--exclude-backups 排除備份和鎖文件--exclude-caches 除標識文件本身外,排除包含CACHEDIR.TAG 的目錄中的內容--exclude-caches-all 排除包含 CACHEDIR.TAG 的目錄--exclude-caches-under 排除包含 CACHEDIR.TAG的目錄中所有內容--exclude-ignore=FILE read exclude patterns for each directory fromFILE, if it exists--exclude-ignore-recursive=FILEread exclude patterns for each directory and itssubdirectories from FILE, if it exists--exclude-tag=FILE 除 FILE 自身外,排除包含 FILE的目錄中的內容--exclude-tag-all=FILE 排除包含 FILE 的目錄--exclude-tag-under=FILE 排除包含 FILE 的目錄中的所有內容--exclude-vcs 排除版本控制系統目錄--exclude-vcs-ignores read exclude patterns from the VCS ignore files-h, --dereference跟蹤符號鏈接;將它們所指向的文件歸檔并輸出--hard-dereference跟蹤硬鏈接;將它們所指向的文件歸檔并輸出-K, --starting-file=MEMBER-NAMEbegin at member MEMBER-NAME when reading thearchive--newer-mtime=DATE 當只有數據改變時比較數據和時間--no-null 禁用上一次的效果 --null 選項--no-recursion 避免目錄中的自動降級--no-unquote do not unquote input file or member names--null -T 讀取以空終止的名字,-C 禁用-N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE只保存比 DATE-OR-FILE 更新的文件--one-file-system 創建歸檔時保存在本地文件系統中-P, --absolute-names don't strip leading '/'s from file names--recursion 目錄遞歸(默認)--suffix=STRING 在刪除前備份,除非被環境變量SIMPLE_BACKUP_SUFFIX覆蓋,否則覆蓋常用后綴(‘’)-T, --files-from=FILE 從 FILE中獲取文件名來解壓或創建文件--unquote unquote input file or member names (default)-X, --exclude-from=FILE 排除 FILE 中列出的模式串文件名變換:--strip-components=NUMBER 解壓時從文件名中清除 NUMBER個引導部分--transform=EXPRESSION, --xform=EXPRESSION使用 sed 代替 EXPRESSION來進行文件名變換文件名匹配選項(同時影響排除和包括模式串):--anchored 模式串匹配文件名頭部--ignore-case 忽略大小寫--no-anchored patterns match after any '/' (default forexclusion)--no-ignore-case 匹配大小寫(默認)--no-wildcards 逐字匹配字符串--no-wildcards-match-slash wildcards do not match '/'--wildcards 使用通配符(默認對 exclusion )--wildcards-match-slash wildcards match '/' (default for exclusion)提示性輸出:--checkpoint[=NUMBER] 每隔 NUMBER個記錄顯示進度信息(默認為 10 個)--checkpoint-action=ACTION 在每個檢查點上執行 ACTION--full-time 按文件原本時間格式打印--index-file=FILE 將詳細輸出發送至 FILE-l, --check-links只要不是所有鏈接都被輸出就打印信息--no-quote-chars=STRING 禁用來自 STRING 的字符引用--quote-chars=STRING 來自 STRING 的額外的引用字符--quoting-style=STYLE 設置名稱引用風格;有效的 STYLE值請參閱以下說明-R, --block-number 每個信息都顯示歸檔內的塊數--show-defaults 顯示 tar 默認選項--show-omitted-dirs列表或解壓時,列出每個不匹配查找標準的目錄--show-snapshot-field-rangesshow valid ranges for snapshot-file fields--show-transformed-names, --show-stored-names顯示變換后的文件名或歸檔名--totals[=SIGNAL] 處理歸檔后打印出總字節數;當此SIGNAL 被觸發時帶參數 -打印總字節數;允許的信號為:SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和SIGUSR2;同時也接受不帶 SIG前綴的信號名稱--utc 以 UTC 格式打印文件修改時間-v, --verbose 詳細地列出處理的文件--warning=KEYWORD 警告控制:-w, --interactive, --confirmation每次操作都要求確認兼容性選項:-o 創建歸檔時,相當于--old-archive;展開歸檔時,相當于--no-same-owner其它選項:-?, --help 顯示此幫助列表--restrict 禁用某些潛在的有危險的選項--usage 顯示簡短的用法說明--version 打印程序版本長選項和相應短選項具有相同的強制參數或可選參數。The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.The version control may be set with --backup or VERSION_CONTROL, values are:none, off never make backupst, numbered make numbered backupsnil, existing numbered if numbered backups exist, simple otherwisenever, simple always make simple backups--quoting-style 選項的有效參數為:literalshellshell-alwayscc-maybeescapelocaleclocale此 tar 默認為:--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/lib/tar/rmt--rsh-command=/usr/bin/rsh將錯誤報告發送到 。
相關信息
-
Ubuntu 13.10不能啟動VirtualBox怎么辦?
我們都知道VirtualBox是一款虛擬機,能夠在Ubuntu系統中運行,但在Ubuntu 13.10運行的時候提示錯誤,導致VirtualBox無法啟動,遇到這個問題怎么辦?下面小編就給大家介紹下Ubuntu13.1...
2019/08/28
-
Linux系統如何安裝配置Sendmail?
Sendmail是目前在網絡上最受歡迎的一種E-mail服務器,在互聯網上是廣受好評,很多企業用戶都在使用。那么,Linux系統如何安裝配置Sendmail呢?下面,我們就一起往下看看Linux系統安裝...
2018/12/19
系統教程欄目
欄目熱門教程
人氣教程排行
站長推薦
熱門系統下載