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]

时间: 2024-10-28 23:24:14

How can I create a zip archive of a whole directory via terminal without hidden files?的相关文章

How do I create a zip file?(转)

Creating a zip file is a task that can easily be accomplished by using the classes ZipOutputStream and ZipEntry in the java.util.zip package. First of all, I'm going to present to you a complete code snippet that will create a zip file containing all

MySQL Community Server 5.5.56 ZIP Archive 绿色解压版 window安装步骤

MySQL Community Server 5.5.56  ZIP Archive  绿色解压版 window安装步骤 首先 准备好启动配置文件my.ini [mysqld] #设置字符集为utf8 loose-default-character-set = utf8 basedir = F:/IDE/mysql5.5 datadir = F:/IDE/mysql5.5/data [client] #设置客户端字符集 loose-default-character-set = utf8 [Wi

Installing MySQL on Microsoft Windows Using a noinstall Zip Archive

这两天在自己的windows7上安装了一下MySQL数据库,安装使用的是5.7.18版本的 noinstall Zip Archive安装包mysql-5.7.18-win32.zip.由于5.7版本相对5.6版本发生了一下变化,很多网上的安装教程都失效了,因此在安装过程中遇到了一系问题,在这里根据自己查看的官方文档和实际的解决过程,整理了一下高版本的MySql的安装步骤,希望对大家有所帮助.详情步骤如下: 1.下载安装包 从https://cdn.mysql.com//Downloads/My

应用商城 下载apk 安装包解析错误 没有权限 Permission denied Android - failed to open zip archive

1.错误提示: 03-31 16:48:43.740: INFO/ActivityManager(59): Start proc com.android.packageinstaller for activity com.android.packageinstaller/.PackageInstallerActivity: pid=620 uid=10026 gids={} 03-31 16:48:44.749: WARN/zipro(620): Unable to open zip '/dat

Mysql下载(on windows-noinstall zip archive)

所有内容,都是针对Mysql5.7.18介绍. 1.首先你需要下载一个完整的包,Mysql目前有两个版本可以使用: a. MySql Enterprise Edition:企业版 b. MySql Community Edtion:社区版 我们下载社区版(GPL)介绍,下载地址:https://dev.mysql.com/downloads/mysql/ 打开后,拉到最底部,下载Windows (x86, 64-bit), ZIP Archive,截个图如下: 原因: mysql-5.7.18-

What to do when the Chinese Characters are messed up when extracting from zip archive?

*/--> What to do when the Chinese Characters are messed up when extracting from zip archive? In some cases, I download zipped files from internet, the files have different encoding as the linux Gnome environment, so the Chinese Characters are all mes

Creating a ZIP Archive in Memory Using System.IO.Compression

Thanks to http://stackoverflow.com/a/12350106/222748 I got: using (var memoryStream = new MemoryStream()) { using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true)) { var demoFile = archive.CreateEntry("foo.txt"); using (v

mysql5.7 Installing MySQL on Microsoft Windows Using a noinstall Zip Archive(mysql解压版安装)

注:参考官网文档 mysql解压版安装配置大致分为以下6步: Extract the main archive to the desired install directory Optional: also extract the debug-test archive if you plan to execute the MySQL benchmark and test suite Create an option file Choose a MySQL server type Initiali

mysql数据库的zip archive安装

第一步,从官网下载自己需要的数据库版本,这里我用的是最新版的5.7.15: 解压你下载的文件,我将其命名为MySQL Server 5.7,我放在了D:\Program Files\下面 你会发现新版的mysql 根目录下并没有data文件夹(稍后处理) 向系统变量path添加路径D:\Program Files\MySQL Server 5.7,你的安装目录,也就是你解压后文件夹的位置.[mysqld] 在mysql的安装目录下(如D:\mywork\mysql-5.7.16-winx64)新