[英]Script to extract only the MaxMind GeoLite2 Country database from gzip containing multiple files
[英]Gzip only files containing “*foo*” over SSH
在目錄中,是否可以僅gzip壓縮包含“ foo”的文件? 我可以通過find . -name "*foo*"
找到它們find . -name "*foo*"
find . -name "*foo*"
但我需要一種存檔方式。
謝謝。
我假設您的意思是存檔到單個tar文件中? 不是單個的.gz文件? 嘗試以下操作:(假設文件沒有太多)
find . -name "*foo*" | xargs tar cvzf archive.tar.gz
一種替代方法是執行以下操作:
find . -name "*foo*" > list.txt
tar cvzf archive.tar.gz -T list.txt #(works only with gnu tar, not bsd i think)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.