Last active
August 29, 2015 14:26
-
-
Save jesusgoku/1bbf41ace1e443618154 to your computer and use it in GitHub Desktop.
Compress files and exclude folders or files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With ZIP. Include complete pattern to exclude | |
zip -9 -r -x"intranet/.git/*" \ | |
-x"intranet/app/logs/*" \ | |
-x"intranet/app/cache/*" \ | |
-x"intranet/.idea/*" \ | |
-x"intranet/files/*" \ | |
-x"intranet/web/compiled/*" \ | |
-x"intranet/vendor/*" \ | |
-x"intranet/web/assets/*" \ | |
intranet.zip \ | |
intranet/ | |
# With TAR. Include partial pattern to exclude | |
tar -cjvf intranet.tar.bz2 \ | |
--exclude ".git/*" \ | |
--exclude "vendor/*" \ | |
--exclude "web/assets/*" \ | |
--exclude "app/logs/*" \ | |
--exclude "app/cache/*" \ | |
--exclude "web/compiled/*" \ | |
--exclude ".idea/*" \ | |
--exclude "files/*" \ | |
--exclude "web/uploads/*" \ | |
intranet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment