相關(guān)參數(shù)
(存檔指tarball)
-c, --create? ? ? ? ? ? ? ? ? ? ?創(chuàng)建新存檔
-x? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?從存檔中提取文件
-z? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?通過(guò)gzip過(guò)濾存檔
-v? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?顯示詳情,詳細(xì)列出已處理文件
-f? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 指定使用的存檔文件? ? ? ? ? ?
-C, --directory=DIR? ? ? ? 改變解壓路徑文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-560538.html
--exclude? ? ? ? ? ? ? ? ? ? ? ? 排除文件文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-560538.html
壓縮
tar -czvf <xxx.tar> <源目錄/文件>
解壓
tar -xzvf <xxx.tar>
解壓時(shí)指定解壓路徑
tar -xzvf <xxx.tar> -C <目標(biāo)路徑>
壓縮時(shí)排除某些目錄/文件
tar -cxvf <xxx.tar> --exclude=</path/example/exclude.1> --exclude=</path/example/exclude.2> <源目錄>
到了這里,關(guān)于Linux - tar命令使用方法記錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!