1. tar xvf將目標(biāo)文件或目錄解包
2. tar cvf將目錄下的文件或目錄打成tar包
3. tar zxvf 將目錄或文件解壓縮并解包
4. tar zcvf 將目錄或文件打成tar包并壓縮 tar解壓文件是后解壓出來(lái)的文件會(huì)自動(dòng)在器目錄下出現(xiàn),不會(huì)移動(dòng)到其他特定位置。如圖1,2
man tar或者tar -h, tar --help
-f, --file=ARCHIVE use archive file or
device ARCHIVE使用檔名(f必須作為最后一個(gè)參數(shù),后面直接跟*.tar)
-c, --create
create a new archive(建立一個(gè)壓縮檔案)
-x, --extract, --get extract files from an archive(從歸檔文件中解出文件)
-z, --gzip, --gunzip, --ungzip filter the archive through gzip(以gzip的壓縮方式存檔)
-j, --bzip2
filter the archive through bzip2(以bzip2的壓縮方式存檔)
-v, --verbose
verbosely list files processed(壓縮過(guò)程中顯示檔案)