av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁技術(shù)文章
文章詳情頁

Linux系統(tǒng)下tar壓縮解壓縮命令詳解

瀏覽:88日期:2023-07-12 10:25:46

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

Linux系統(tǒng)下tar壓縮解壓縮命令詳解

tar:

-c: 建立壓縮檔案

-x:解壓

-t:查看內(nèi)容

-r:向壓縮歸檔文件末尾追加文件

-u:更新原壓縮包中的文件

這五個(gè)是獨(dú)立的命令,壓縮解壓都要用到其中一個(gè),可以和別的命令連用但只能用其中一個(gè)。下面的參數(shù)是根據(jù)需要在壓縮或解壓檔案時(shí)可選的。

-z:有g(shù)zip屬性的

-j:有bz2屬性的

-Z:有compress屬性的

-v:顯示所有過程

-O:將文件解開到標(biāo)準(zhǔn)輸出

下面的參數(shù)-f是必須的

-f: 使用檔案名字,切記,這個(gè)參數(shù)是最后一個(gè)參數(shù),后面只能接檔案名。

# tar -cf all.tar *.jpg

這條命令是將所有.jpg的文件打成一個(gè)名為all.tar的包。-c是表示產(chǎn)生新的包,-f指定包的文件名。

# tar -rf all.tar *.gif

這條命令是將所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。

# tar -uf all.tar logo.gif

這條命令是更新原來tar包all.tar中l(wèi)ogo.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壓縮,生成一個(gè)gzip壓縮過的包,命名為jpg.tar.gz

tar -cjf jpg.tar.bz2 *.jpg //將目錄里所有jpg文件打包成jpg.tar后,并且將其用bzip2壓縮,生成一個(gè)bzip2壓縮過的包,命名為jpg.tar.bz2

tar -cZf jpg.tar.Z *.jpg //將目錄里所有jpg文件打包成jpg.tar后,并且將其用compress壓縮,生成一個(gè)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

總結(jié):

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 --help02用法: tar [選項(xiàng)...] [FILE]...03GNU 'tar' saves many files together into a single tape or disk archive, and can04restore 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 創(chuàng)建一個(gè)新歸檔12-d, --diff, --compare 找出歸檔和文件系統(tǒng)的差異13--delete 從歸檔(非磁帶!)中刪除14-r, --append 追加文件至歸檔結(jié)尾15-t, --list 列出歸檔內(nèi)容16--test-label 測試歸檔卷標(biāo)并退出17-u, --update 僅追加比歸檔中副本更新的文件18-x, --extract, --get 從歸檔中解出文件19操作修飾符:20--check-device 當(dāng)創(chuàng)建增量歸檔時(shí)檢查設(shè)備號(默認(rèn))21-g, --listed-incremental=FILE 處理新式的 GNU 格式的增量備份22-G, --incremental 處理老式的 GNU 格式的增量備份23--ignore-failed-read24當(dāng)遇上不可讀文件時(shí)不要以非零值退出25--level=NUMBER 所創(chuàng)建的增量列表歸檔的輸出級別26-n, --seek 歸檔可檢索27--no-check-device 當(dāng)創(chuàng)建增量歸檔時(shí)不要檢查設(shè)備號28--no-seek 歸檔不可檢索29--occurrence[=NUMBER] 僅處理歸檔中每個(gè)文件的第 NUMBER30個(gè)事件;僅當(dāng)與以下子命令 --delete,31--diff, --extract 或是 --list32中的一個(gè)聯(lián)合使用時(shí),此選項(xiàng)才有效。而且不管文件列表是以命令行形式給出或是通過33-T 選項(xiàng)指定的;NUMBER 值默認(rèn)為 134--sparse-version=MAJOR[.MINOR]35設(shè)置所用的離散格式版本(隱含36--sparse)37-S, --sparse 高效處理離散文件38重寫控制:39-k, --keep-old-files don't replace existing files when extracting,40treat them as errors41--keep-directory-symlink preserve existing symlinks to directories when42extracting43--keep-newer-files44不要替換比歸檔中副本更新的已存在的文件45--no-overwrite-dir 保留已存在目錄的元數(shù)據(jù)46--one-top-level[=DIR] create a subdirectory to avoid having loose files47extracted48--overwrite 解壓時(shí)重寫存在的文件49--overwrite-dir解壓時(shí)重寫已存在目錄的元數(shù)據(jù)(默認(rèn))50--recursive-unlink 解壓目錄之前先清除目錄層次51--remove-files 在添加文件至歸檔后刪除它們52--skip-old-files don't replace existing files when extracting,53silently skip over them54-U, --unlink-first 在解壓要重寫的文件之前先刪除它們55-W, --verify 在寫入以后嘗試校驗(yàn)歸檔56選擇輸出流:57--ignore-command-error 忽略子進(jìn)程的退出代碼58--no-ignore-command-error59將子進(jìn)程的非零退出代碼認(rèn)為發(fā)生錯(cuò)誤60-O, --to-stdout 解壓文件至標(biāo)準(zhǔn)輸出61--to-command=COMMAND62將解壓的文件通過管道傳送至另一個(gè)程序63操作文件屬性:64--atime-preserve[=METHOD]65在輸出的文件上保留訪問時(shí)間,要么通過在讀取(默認(rèn)66METHOD=‘replace’)后還原時(shí)間,要不就不要在第一次(METHOD=‘system’)設(shè)置時(shí)間67--clamp-mtime only set time when the file is more recent than68what was given with --mtime69--delay-directory-restore70直到解壓結(jié)束才設(shè)置修改時(shí)間和所解目錄的權(quán)限71--group=名稱 強(qiáng)制將 NAME72作為所添加的文件的組所有者73--mode=CHANGES 強(qiáng)制將所添加的文件(符號)更改為權(quán)限74CHANGES75--mtime=DATE-OR-FILE 從 DATE-OR-FILE 中為添加的文件設(shè)置76mtime77-m, --touch不要解壓文件的修改時(shí)間78--no-delay-directory-restore79取消 --delay-directory-restore 選項(xiàng)的效果80--no-same-owner81將文件解壓為您所有(普通用戶默認(rèn)此項(xiàng))82--no-same-permissions83從歸檔中解壓權(quán)限時(shí)使用用戶的掩碼位(默認(rèn)為普通用戶服務(wù))84--numeric-owner總是以數(shù)字代表用戶/組的名稱85--owner=名稱 強(qiáng)制將 NAME86作為所添加的文件的所有者87-p, --preserve-permissions, --same-permissions88解壓文件權(quán)限信息(默認(rèn)只為超級用戶服務(wù))89--preserve 與 -p 和 -s 一樣90--same-owner91嘗試解壓時(shí)保持所有者關(guān)系一致(超級用戶默認(rèn)此項(xiàng))92-s, --preserve-order, --same-order93member arguments are listed in the same order as94the files in the archive95--sort=ORDER directory sorting order: none (default), name or96inode97Handling of extended file attributes:98--acls Enable the POSIX ACLs support99--no-acls Disable the POSIX ACLs support100--no-selinux Disable the SELinux context support101--no-xattrs Disable extended attributes support102--selinux Enable the SELinux context support103--xattrs Enable extended attributes support104--xattrs-exclude=MASK specify the exclude pattern for xattr keys105--xattrs-include=MASK specify the include pattern for xattr keys106設(shè)備選擇和切換:107-f, --file=ARCHIVE 使用歸檔文件或 ARCHIVE 設(shè)備108--force-local109即使歸檔文件存在副本還是把它認(rèn)為是本地歸檔110-F, --info-script=名稱, --new-volume-script=名稱111在每卷磁帶最后運(yùn)行腳本(隱含 -M)112-L, --tape-length=NUMBER 寫入 NUMBER × 1024 字節(jié)后更換磁帶113-M, --multi-volume 創(chuàng)建/列出/解壓多卷歸檔文件114--rmt-command=COMMAND 使用指定的 rmt COMMAND 代替 rmt115--rsh-command=COMMAND 使用遠(yuǎn)程 COMMAND 代替 rsh116--volno-file=FILE 使用/更新 FILE 中的卷數(shù)117設(shè)備分塊:118-b, --blocking-factor=BLOCKS 每個(gè)記錄 BLOCKS x 512 字節(jié)119-B, --read-full-records 讀取時(shí)重新分塊(只對 4.2BSD 管道有效)120-i, --ignore-zeros 忽略歸檔中的零字節(jié)塊(即文件結(jié)尾)121--record-size=NUMBER 每個(gè)記錄的字節(jié)數(shù) NUMBER,乘以 512122選擇歸檔格式:123-H, --format=FORMAT創(chuàng)建指定格式的歸檔124FORMAT 是以下格式中的一種:125gnu GNU tar 1.13.x 格式126oldgnu GNU 格式 as per tar <= 1.12127pax POSIX 1003.1-2001 (pax) 格式128posix 等同于 pax129ustar POSIX 1003.1-1988 (ustar) 格式130v7 old V7 tar 格式131--old-archive, --portability132等同于 --format=v7133--pax-option=關(guān)鍵字[[:]=值][,關(guān)鍵字[[:]=值]]...134控制 pax 關(guān)鍵字135--posix等同于 --format=posix136-V, --label=TEXT 創(chuàng)建帶有卷名 TEXT137的歸檔;在列出/解壓時(shí),使用 TEXT138作為卷名的模式串139壓縮選項(xiàng):140-a, --auto-compress使用歸檔后綴名來決定壓縮程序141-I, --use-compress-program=PROG142通過 PROG 過濾(必須是能接受 -d143選項(xiàng)的程序)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開始會(huì)很有用的)155--backup[=CONTROL] 在刪除前備份,選擇 CONTROL 版本156-C, --directory=DIR改變至目錄 DIR157--exclude=PATTERN 排除以 PATTERN 指定的文件158--exclude-backups 排除備份和鎖文件159--exclude-caches 除標(biāo)識(shí)文件本身外,排除包含160CACHEDIR.TAG 的目錄中的內(nèi)容161--exclude-caches-all 排除包含 CACHEDIR.TAG 的目錄162--exclude-caches-under 排除包含 CACHEDIR.TAG163的目錄中所有內(nèi)容164--exclude-ignore=FILE read exclude patterns for each directory from165FILE, if it exists166--exclude-ignore-recursive=FILE167read exclude patterns for each directory and its168subdirectories from FILE, if it exists169--exclude-tag=FILE 除 FILE 自身外,排除包含 FILE170的目錄中的內(nèi)容171--exclude-tag-all=FILE 排除包含 FILE 的目錄172--exclude-tag-under=FILE 排除包含 FILE 的目錄中的所有內(nèi)容173--exclude-vcs 排除版本控制系統(tǒng)目錄174--exclude-vcs-ignores read exclude patterns from the VCS ignore files175-h, --dereference176跟蹤符號鏈接;將它們所指向的文件歸檔并輸出177--hard-dereference178跟蹤硬鏈接;將它們所指向的文件歸檔并輸出179-K, --starting-file=MEMBER-NAME180begin at member MEMBER-NAME when reading the181archive182--newer-mtime=DATE 當(dāng)只有數(shù)據(jù)改變時(shí)比較數(shù)據(jù)和時(shí)間183--no-null 禁用上一次的效果 --null 選項(xiàng)184--no-recursion 避免目錄中的自動(dòng)降級185--no-unquote do not unquote input file or member names186--null -T 讀取以空終止的名字,-C 禁用187-N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE188只保存比 DATE-OR-FILE 更新的文件189--one-file-system 創(chuàng)建歸檔時(shí)保存在本地文件系統(tǒng)中190-P, --absolute-names don't strip leading '/'s from file names191--recursion 目錄遞歸(默認(rèn))192--suffix=STRING在刪除前備份,除非被環(huán)境變量193SIMPLE_BACKUP_SUFFIX194覆蓋,否則覆蓋常用后綴(‘’)195-T, --files-from=FILE 從 FILE196中獲取文件名來解壓或創(chuàng)建文件197--unquote unquote input file or member names (default)198-X, --exclude-from=FILE 排除 FILE 中列出的模式串199文件名變換:200--strip-components=NUMBER 解壓時(shí)從文件名中清除 NUMBER201個(gè)引導(dǎo)部分202--transform=EXPRESSION, --xform=EXPRESSION203使用 sed 代替 EXPRESSION204來進(jìn)行文件名變換205文件名匹配選項(xiàng)(同時(shí)影響排除和包括模式串):206--anchored 模式串匹配文件名頭部207--ignore-case 忽略大小寫208--no-anchored patterns match after any '/' (default for209exclusion)210--no-ignore-case 匹配大小寫(默認(rèn))211--no-wildcards 逐字匹配字符串212--no-wildcards-match-slash wildcards do not match '/'213--wildcards 使用通配符(默認(rèn)對 exclusion )214--wildcards-match-slash wildcards match '/' (default for exclusion)215提示性輸出:216--checkpoint[=NUMBER] 每隔 NUMBER217個(gè)記錄顯示進(jìn)度信息(默認(rèn)為 10 個(gè))218--checkpoint-action=ACTION 在每個(gè)檢查點(diǎn)上執(zhí)行 ACTION219--full-time 按文件原本時(shí)間格式打印220--index-file=FILE 將詳細(xì)輸出發(fā)送至 FILE221-l, --check-links222只要不是所有鏈接都被輸出就打印信息223--no-quote-chars=STRING 禁用來自 STRING 的字符引用224--quote-chars=STRING 來自 STRING 的額外的引用字符225--quoting-style=STYLE 設(shè)置名稱引用風(fēng)格;有效的 STYLE226值請參閱以下說明227-R, --block-number 每個(gè)信息都顯示歸檔內(nèi)的塊數(shù)228--show-defaults顯示 tar 默認(rèn)選項(xiàng)229--show-omitted-dirs230列表或解壓時(shí),列出每個(gè)不匹配查找標(biāo)準(zhǔn)的目錄231--show-snapshot-field-ranges232show valid ranges for snapshot-file fields233--show-transformed-names, --show-stored-names234顯示變換后的文件名或歸檔名235--totals[=SIGNAL] 處理歸檔后打印出總字節(jié)數(shù);當(dāng)此236SIGNAL 被觸發(fā)時(shí)帶參數(shù) -237打印總字節(jié)數(shù);允許的信號為:238SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和239SIGUSR2;同時(shí)也接受不帶 SIG240前綴的信號名稱241--utc 以 UTC 格式打印文件修改時(shí)間242-v, --verbose 詳細(xì)地列出處理的文件243--warning=KEYWORD 警告控制:244-w, --interactive, --confirmation245每次操作都要求確認(rèn)246兼容性選項(xiàng):247-o 創(chuàng)建歸檔時(shí),相當(dāng)于248--old-archive;展開歸檔時(shí),相當(dāng)于249--no-same-owner250其它選項(xiàng):251-?, --help 顯示此幫助列表252--restrict 禁用某些潛在的有危險(xiǎn)的選項(xiàng)253--usage顯示簡短的用法說明254--version 打印程序版本255長選項(xiàng)和相應(yīng)短選項(xiàng)具有相同的強(qiáng)制參數(shù)或可選參數(shù)。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 backups259t, numbered make numbered backups260nil, existing numbered if numbered backups exist, simple otherwise261never, simple always make simple backups262--quoting-style 選項(xiàng)的有效參數(shù)為:263literal264shell265shell-always266c267c-maybe268escape269locale270clocale271此 tar 默認(rèn)為:272--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/lib/tar/rmt273--rsh-command=/usr/bin/rsh274將錯(cuò)誤報(bào)告發(fā)送到 <bug-tar@gnu.org>。復(fù)制代碼root@ubuntu:~# tar --help用法: tar [選項(xiàng)...] [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 創(chuàng)建一個(gè)新歸檔-d, --diff, --compare 找出歸檔和文件系統(tǒng)的差異--delete 從歸檔(非磁帶!)中刪除-r, --append 追加文件至歸檔結(jié)尾-t, --list 列出歸檔內(nèi)容--test-label 測試歸檔卷標(biāo)并退出-u, --update 僅追加比歸檔中副本更新的文件-x, --extract, --get 從歸檔中解出文件操作修飾符:--check-device 當(dāng)創(chuàng)建增量歸檔時(shí)檢查設(shè)備號(默認(rèn))-g, --listed-incremental=FILE 處理新式的 GNU 格式的增量備份-G, --incremental 處理老式的 GNU 格式的增量備份--ignore-failed-read當(dāng)遇上不可讀文件時(shí)不要以非零值退出--level=NUMBER 所創(chuàng)建的增量列表歸檔的輸出級別-n, --seek 歸檔可檢索--no-check-device 當(dāng)創(chuàng)建增量歸檔時(shí)不要檢查設(shè)備號--no-seek 歸檔不可檢索--occurrence[=NUMBER] 僅處理歸檔中每個(gè)文件的第 NUMBER個(gè)事件;僅當(dāng)與以下子命令 --delete,--diff, --extract 或是 --list中的一個(gè)聯(lián)合使用時(shí),此選項(xiàng)才有效。而且不管文件列表是以命令行形式給出或是通過-T 選項(xiàng)指定的;NUMBER 值默認(rèn)為 1--sparse-version=MAJOR[.MINOR]設(shè)置所用的離散格式版本(隱含--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 保留已存在目錄的元數(shù)據(jù)--one-top-level[=DIR] create a subdirectory to avoid having loose filesextracted--overwrite 解壓時(shí)重寫存在的文件--overwrite-dir解壓時(shí)重寫已存在目錄的元數(shù)據(jù)(默認(rèn))--recursive-unlink 解壓目錄之前先清除目錄層次--remove-files 在添加文件至歸檔后刪除它們--skip-old-files don't replace existing files when extracting,silently skip over them-U, --unlink-first 在解壓要重寫的文件之前先刪除它們-W, --verify 在寫入以后嘗試校驗(yàn)歸檔選擇輸出流:--ignore-command-error 忽略子進(jìn)程的退出代碼--no-ignore-command-error將子進(jìn)程的非零退出代碼認(rèn)為發(fā)生錯(cuò)誤-O, --to-stdout 解壓文件至標(biāo)準(zhǔn)輸出--to-command=COMMAND將解壓的文件通過管道傳送至另一個(gè)程序操作文件屬性:--atime-preserve[=METHOD]在輸出的文件上保留訪問時(shí)間,要么通過在讀取(默認(rèn)METHOD=‘replace’)后還原時(shí)間,要不就不要在第一次(METHOD=‘system’)設(shè)置時(shí)間--clamp-mtime only set time when the file is more recent thanwhat was given with --mtime--delay-directory-restore直到解壓結(jié)束才設(shè)置修改時(shí)間和所解目錄的權(quán)限--group=名稱 強(qiáng)制將 NAME作為所添加的文件的組所有者--mode=CHANGES 強(qiáng)制將所添加的文件(符號)更改為權(quán)限CHANGES--mtime=DATE-OR-FILE 從 DATE-OR-FILE 中為添加的文件設(shè)置mtime-m, --touch不要解壓文件的修改時(shí)間--no-delay-directory-restore取消 --delay-directory-restore 選項(xiàng)的效果--no-same-owner將文件解壓為您所有(普通用戶默認(rèn)此項(xiàng))--no-same-permissions從歸檔中解壓權(quán)限時(shí)使用用戶的掩碼位(默認(rèn)為普通用戶服務(wù))--numeric-owner總是以數(shù)字代表用戶/組的名稱--owner=名稱 強(qiáng)制將 NAME作為所添加的文件的所有者-p, --preserve-permissions, --same-permissions解壓文件權(quán)限信息(默認(rèn)只為超級用戶服務(wù))--preserve 與 -p 和 -s 一樣--same-owner嘗試解壓時(shí)保持所有者關(guān)系一致(超級用戶默認(rèn)此項(xiàng))-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設(shè)備選擇和切換:-f, --file=ARCHIVE 使用歸檔文件或 ARCHIVE 設(shè)備--force-local即使歸檔文件存在副本還是把它認(rèn)為是本地歸檔-F, --info-script=名稱, --new-volume-script=名稱在每卷磁帶最后運(yùn)行腳本(隱含 -M)-L, --tape-length=NUMBER 寫入 NUMBER × 1024 字節(jié)后更換磁帶-M, --multi-volume 創(chuàng)建/列出/解壓多卷歸檔文件--rmt-command=COMMAND 使用指定的 rmt COMMAND 代替 rmt--rsh-command=COMMAND 使用遠(yuǎn)程 COMMAND 代替 rsh--volno-file=FILE 使用/更新 FILE 中的卷數(shù)設(shè)備分塊:-b, --blocking-factor=BLOCKS 每個(gè)記錄 BLOCKS x 512 字節(jié)-B, --read-full-records 讀取時(shí)重新分塊(只對 4.2BSD 管道有效)-i, --ignore-zeros 忽略歸檔中的零字節(jié)塊(即文件結(jié)尾)--record-size=NUMBER 每個(gè)記錄的字節(jié)數(shù) NUMBER,乘以 512選擇歸檔格式:-H, --format=FORMAT創(chuàng)建指定格式的歸檔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=關(guān)鍵字[[:]=值][,關(guān)鍵字[[:]=值]]...控制 pax 關(guān)鍵字--posix等同于 --format=posix-V, --label=TEXT 創(chuàng)建帶有卷名 TEXT的歸檔;在列出/解壓時(shí),使用 TEXT作為卷名的模式串壓縮選項(xiàng):-a, --auto-compress使用歸檔后綴名來決定壓縮程序-I, --use-compress-program=PROG通過 PROG 過濾(必須是能接受 -d選項(xiàng)的程序)-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 至歸檔(如果名字以 -開始會(huì)很有用的)--backup[=CONTROL] 在刪除前備份,選擇 CONTROL 版本-C, --directory=DIR改變至目錄 DIR--exclude=PATTERN 排除以 PATTERN 指定的文件--exclude-backups 排除備份和鎖文件--exclude-caches 除標(biāo)識(shí)文件本身外,排除包含CACHEDIR.TAG 的目錄中的內(nèi)容--exclude-caches-all 排除包含 CACHEDIR.TAG 的目錄--exclude-caches-under 排除包含 CACHEDIR.TAG的目錄中所有內(nèi)容--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的目錄中的內(nèi)容--exclude-tag-all=FILE 排除包含 FILE 的目錄--exclude-tag-under=FILE 排除包含 FILE 的目錄中的所有內(nèi)容--exclude-vcs 排除版本控制系統(tǒng)目錄--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 當(dāng)只有數(shù)據(jù)改變時(shí)比較數(shù)據(jù)和時(shí)間--no-null 禁用上一次的效果 --null 選項(xiàng)--no-recursion 避免目錄中的自動(dòng)降級--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 創(chuàng)建歸檔時(shí)保存在本地文件系統(tǒng)中-P, --absolute-names don't strip leading '/'s from file names--recursion 目錄遞歸(默認(rèn))--suffix=STRING在刪除前備份,除非被環(huán)境變量SIMPLE_BACKUP_SUFFIX覆蓋,否則覆蓋常用后綴(‘’)-T, --files-from=FILE 從 FILE中獲取文件名來解壓或創(chuàng)建文件--unquote unquote input file or member names (default)-X, --exclude-from=FILE 排除 FILE 中列出的模式串文件名變換:--strip-components=NUMBER 解壓時(shí)從文件名中清除 NUMBER個(gè)引導(dǎo)部分--transform=EXPRESSION, --xform=EXPRESSION使用 sed 代替 EXPRESSION來進(jìn)行文件名變換文件名匹配選項(xiàng)(同時(shí)影響排除和包括模式串):--anchored 模式串匹配文件名頭部--ignore-case 忽略大小寫--no-anchored patterns match after any '/' (default forexclusion)--no-ignore-case 匹配大小寫(默認(rèn))--no-wildcards 逐字匹配字符串--no-wildcards-match-slash wildcards do not match '/'--wildcards 使用通配符(默認(rèn)對 exclusion )--wildcards-match-slash wildcards match '/' (default for exclusion)提示性輸出:--checkpoint[=NUMBER] 每隔 NUMBER個(gè)記錄顯示進(jìn)度信息(默認(rèn)為 10 個(gè))--checkpoint-action=ACTION 在每個(gè)檢查點(diǎn)上執(zhí)行 ACTION--full-time 按文件原本時(shí)間格式打印--index-file=FILE 將詳細(xì)輸出發(fā)送至 FILE-l, --check-links只要不是所有鏈接都被輸出就打印信息--no-quote-chars=STRING 禁用來自 STRING 的字符引用--quote-chars=STRING 來自 STRING 的額外的引用字符--quoting-style=STYLE 設(shè)置名稱引用風(fēng)格;有效的 STYLE值請參閱以下說明-R, --block-number 每個(gè)信息都顯示歸檔內(nèi)的塊數(shù)--show-defaults顯示 tar 默認(rèn)選項(xiàng)--show-omitted-dirs列表或解壓時(shí),列出每個(gè)不匹配查找標(biāo)準(zhǔn)的目錄--show-snapshot-field-rangesshow valid ranges for snapshot-file fields--show-transformed-names, --show-stored-names顯示變換后的文件名或歸檔名--totals[=SIGNAL] 處理歸檔后打印出總字節(jié)數(shù);當(dāng)此SIGNAL 被觸發(fā)時(shí)帶參數(shù) -打印總字節(jié)數(shù);允許的信號為:SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和SIGUSR2;同時(shí)也接受不帶 SIG前綴的信號名稱--utc 以 UTC 格式打印文件修改時(shí)間-v, --verbose 詳細(xì)地列出處理的文件--warning=KEYWORD 警告控制:-w, --interactive, --confirmation每次操作都要求確認(rèn)兼容性選項(xiàng):-o 創(chuàng)建歸檔時(shí),相當(dāng)于--old-archive;展開歸檔時(shí),相當(dāng)于--no-same-owner其它選項(xiàng):-?, --help 顯示此幫助列表--restrict 禁用某些潛在的有危險(xiǎn)的選項(xiàng)--usage顯示簡短的用法說明--version 打印程序版本長選項(xiàng)和相應(yīng)短選項(xiàng)具有相同的強(qiáng)制參數(shù)或可選參數(shù)。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 選項(xiàng)的有效參數(shù)為:literalshellshell-alwayscc-maybeescapelocaleclocale此 tar 默認(rèn)為:--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/lib/tar/rmt--rsh-command=/usr/bin/rsh將錯(cuò)誤報(bào)告發(fā)送到 <bug-tar@gnu.org>。

關(guān)于Linux下的tar壓縮解壓縮命令就給大家敘述到這里了,使用Linux系統(tǒng)的用戶,可以多做了解!

標(biāo)簽: Linux系統(tǒng)
相關(guān)文章:
主站蜘蛛池模板: 亚洲欧美成人 | 亚洲一区二区中文字幕在线观看 | 免费成人高清在线视频 | 国产精品久久久久一区二区三区 | 在线观看第一区 | 国产美女在线播放 | 亚洲国产一区二区三区四区 | 国产羞羞视频在线观看 | 日韩日韩日韩日韩日韩日韩日韩 | 亚洲国产精品一区二区久久 | 视频一区二区三区在线观看 | 国产精品久久久久久久 | 精品视频在线观看 | 国产精品日韩欧美一区二区三区 | 国产精品久久久久久久久久久免费看 | 一区二区三区在线播放 | 免费观看一级黄色录像 | 国产精品资源在线观看 | 亚洲欧美中文日韩在线v日本 | 国产精品久久久久久久毛片 | 色婷婷精品久久二区二区蜜臂av | 精品日韩一区二区 | 欧美极品在线视频 | 久久精品免费观看 | 羞羞色网站 | 精品国产乱码久久久久久久久 | 天堂综合网 | 国产一区二区欧美 | 日本不卡高清视频 | 亚洲天堂免费 | 一区二区三区欧美 | 久久噜噜噜精品国产亚洲综合 | 91精品国产高清一区二区三区 | 在线免费观看黄a | 日韩欧美三级 | 亚洲美女av网站 | 国产精品欧美一区二区 | 日本天天色 | 伊人精品久久久久77777 | 在线免费观看成人 | 成人黄页在线观看 |