How do I tar a list of files and folders (all in the same directory) with the exclusion of a single directory (which contains a huge amount of data)
我如何tar一个文件和文件夹列表(所有在同一目录中),排除一个目录(包含大量数据)
2 个解决方案
#1
7
tar --exclude=PATTERN xvzf nameof.tar.gz ./*
tar --exclude = PATTERN xvzf nameof.tar.gz ./*
PATTERN can be the directory name. GNU tar.
PATTERN可以是目录名称。 GNU tar。
#2
0
I think it may depend on your version of tar. You can use 'man tar' or 'tar --help' to check for details on your version. But the options I found are:
我认为这可能取决于你的tar版本。您可以使用'man tar'或'tar --help'来查看您的版本的详细信息。但我找到的选项是:
tar -X filename: excludes anything listed in the given text file
tar --exclude=pattern: excludes anything matching the pattern
tar -X filename:排除给定文本文件中列出的任何内容tar --exclude = pattern:排除与模式匹配的任何内容
#1
7
tar --exclude=PATTERN xvzf nameof.tar.gz ./*
tar --exclude = PATTERN xvzf nameof.tar.gz ./*
PATTERN can be the directory name. GNU tar.
PATTERN可以是目录名称。 GNU tar。
#2
0
I think it may depend on your version of tar. You can use 'man tar' or 'tar --help' to check for details on your version. But the options I found are:
我认为这可能取决于你的tar版本。您可以使用'man tar'或'tar --help'来查看您的版本的详细信息。但我找到的选项是:
tar -X filename: excludes anything listed in the given text file
tar --exclude=pattern: excludes anything matching the pattern
tar -X filename:排除给定文本文件中列出的任何内容tar --exclude = pattern:排除与模式匹配的任何内容