Skip to content

Instantly share code, notes, and snippets.

@FernE97
Last active December 18, 2015 04:38
Show Gist options
  • Save FernE97/5726338 to your computer and use it in GitHub Desktop.
Save FernE97/5726338 to your computer and use it in GitHub Desktop.
Reminders for creating a tgz file
## 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' .
@FernE97
Copy link
Author

FernE97 commented Jun 14, 2013

-c, --create
-v, --verbose
-z, --gzip, --ungzip
-f, --file=archive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment