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.
使用以下命令:
tar --exclude="./.*" -czvf /Volumes/Foo/2016-04-14_2051_full.tar.xz ./
遵循这个建议,仍然会获得隐藏文件存档:
a . a ./.Trashes a ./.fseventsd a ./data
我该怎么做才能只./data归档文件夹?
./data
更新:我使用 Mac 和 zsh shell。
我现在使用了解决方法:
XZ_OPT=-9e tar --exclude='./old' --exclude='.*' -cJvf /Volumes/Foo/$(date +%Y%m%dT%H%M)_full.tar.xz * -g incremetal
希望它对其他人也有帮助