tar: The following options were used after any non-optional arguments in archive create or update mode
tar -czvf test.tar.gz * --exclude=test1
#此方式适用于tar1.30版本以下,否则报错(tar1.26版本无此问题)
tar: The following options were used after any non-optional arguments in archive create or update mode. These options are positional and affect only arguments that follow them. Please, rearrange them properly.
#版本检查
tar --version
–exclude需要排前面即可,例:
tar --exclude=test1 -czvf test.tar.gz *
或
tar -czvf test.tar.gz --exclude=test1 *