![](/img/trans.png)
[英]How to find the number of lines of the files inside a tar file without extracting
[英]How to tar several files without containing their whole path in tar file
假設我在/tmp
。 我想tar /tmp/aaa/123
, /tmp/bbb/222
。 我使用的命令是: tar -vczf /tmp/my.tar.gz /tmp/aaa/123 /tmp/bbb/222
。 此命令工作正常。
但是,當我使用tar -zxvf my.tar.gz
解壓縮tar文件時,它給了我2個文件(假設我將my.tar.gz復制到了名為pwd的路徑中,現在我處於pwd中):pwd / tmp / aaa / 123和pwd / tmp / bbb / 222。 我期望的結果是pwd / my / 123和pwd / my / 222。
有什么我可以用來實現的命令嗎?
只需使用--directory選項即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.