Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个存档 foo.tar.gz(实际大小为 8M),其中包含一个大型稀疏文件(大约 10G)。
我的问题是,如果不提取存档,我怎么能知道实际的稀疏文件大小?
tar ztvf foo.tar.gz
将列出文件的内容而不提取。
该--totals选项导致 tar 在标准错误上打印处理存档时传输的总字节数。
--totals
tar ztvf foo.tar.gz --totals
将返回读取的字节总数(本质上是提取后存档的大小)。
如果您正在存档中查找特定文件,例如模式 FOOBAR,
FOOBAR
tar ztvf foo.tar.gz -v --wildcards '*FOOBAR*'
将列出包含该大小的匹配文件。