Last active
December 18, 2015 04:38
-
-
Save FernE97/5726338 to your computer and use it in GitHub Desktop.
Reminders for creating a tgz file
This file contains 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
## Disable mac ._ hidden files | |
$ export COPYFILE_DISABLE=true | |
$ cd directory-name | |
## Filename then path to folder | |
$ tar -cvzf filename.tgz folder-name | |
## Period will zip all files from current directory | |
$ tar -cvzf filename.tgz . | |
## Exclude folders or file types | |
$ tar -cvzf filename.tgz --exclude 'path/folder' --exclude '*.zip' . | |
## Real world example for WordPress - exclude large upload dir or potential backups | |
$ tar -czf wp-content.tgz --exclude 'wp-content/uploads' --exclude '*.zip' . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-c, --create
-v, --verbose
-z, --gzip, --ungzip
-f, --file=archive