How can I create a zip archive of a whole directory via terminal without hidden files?

Source: Internet
Author: User

I have a project with lots of hidden folders/files in it. I want to create a zip-archive of it, but the archive shouldn ' t is any hidden folders/files. If files in a hidden folder is not hidden, they should also isn't 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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.