我想创建一个tar文件来压缩包含子文件夹的文件夹。我正在终端中尝试以下命令int:
tar -czf folder directorios.tar.gz
directorios.tar.gz将是结果
尝试:
tar -czvf directorios.tar.gz folder
一些注意事项:
在手册页中,递归是默认值tar
:
-c, --create
Create a new archive. Arguments supply the names of the files to be archived.
Directories are archived recursively, unless the --no-recursion option is
given.
尽管可以使用--no-recursion
选项关闭...
您需要存档名称后的-f
选项中,正确的顺序是:
tar -c [-f ARCHIVE] [OPTIONS] [FILE...]
^^^^^^^^^^
对于更灵活的命令行(特别是如果您想使用gzip和tar以外的其他压缩实用程序),可以省略-z
选项,而使用-a
或--auto-compress
option允许tar根据档案后缀自动确定要使用的压缩器:
-a, --auto-compress
Use archive suffix to determine the compression program.
公认的后缀(及其伴随的压缩应用程序)为:
焦油很酷:)
参考:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句