tar cjf <your-name-in-specific-path> <your-directory-path>
c: Create
j: Use bzip2 for compression
f: Save it to given file name
Run Code Online (Sandbox Code Playgroud)
注意:如果您的 tar 版本没有这些选项,您可以按照以下说明进行操作:
tar cf <your-name-in-specific-path> <your-directory-path>
gzip <your-name-in-specific-path>
注意:您可以使用其他工具压缩您的文件,例如bzip2
,xz
等等。