Skip to content

Instantly share code, notes, and snippets.

@skellertor
Last active September 18, 2015 06:11
Show Gist options
  • Save skellertor/27efab8030f7a5a9e472 to your computer and use it in GitHub Desktop.
Save skellertor/27efab8030f7a5a9e472 to your computer and use it in GitHub Desktop.
*nix commands for working with tar files
# Tarball and compress entire directory

πŸ“ tar -zcvf archive-name.tar.gz directory-name

# Tarball and compress files individually

πŸ“„ tar -cvf file1 file2 dir3 | gzip > archive-name.tar.gz

# Extract contents of compressed tar file

πŸ“‚ tar -zxvf archive-name.tar.gz

What options mean:

  • z: Compress archive using gzip program
  • c: Create archive
  • v: Verbose i.e display progress while creating archive
  • f: Archive file name
  • x: Extract file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment