码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-07-03 13:07:43      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

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 -@

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

标签:

原文地址:http://www.cnblogs.com/qike/p/5637837.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!