How can I create a zip archive of a whole directory via terminal without hidden files?
Posted qike_
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了How can I create a zip archive of a whole directory via terminal without hidden files?相关的知识,希望对你有一定的参考价值。
I have a project with lots of hidden folders / files in it. I want to create a zip-archive of it, but in the archive shouldn‘t be any hidden folders / files. If files in a hidden folder are not hidden, they should also not be included.
I know that I can create a zip archive of a directory like this:
zip -r zipfile.zip directory
I also know that I can exclude files with the -x option, so I thought this might work:
zip -r zipfile.zip directory -x .*
It didn‘t work. All hidden directories were still in the zip-file.
This also excludes hidden files in unhidden directories:
find /full_path -path ‘*/.*‘ -prune -o -type f -print | zip ~/file.zip [email protected]
以上是关于How can I create a zip archive of a whole directory via terminal without hidden files?的主要内容,如果未能解决你的问题,请参考以下文章
How can I manually create a authentication cookie instead of the default method?
How can I add files to a Jar file?