Skip to content

Instantly share code, notes, and snippets.

@lg3bass
Created August 17, 2016 15:29
Show Gist options
  • Save lg3bass/42c23357e1857c127a76c1d52121d0ab to your computer and use it in GitHub Desktop.
Save lg3bass/42c23357e1857c127a76c1d52121d0ab to your computer and use it in GitHub Desktop.
UNIX tar.gz a directory via ssh
//source: http://unix.stackexchange.com/questions/93139/can-i-zip-an-entire-folder-using-gzip
//In order to "zip" a directory, the correct command would be
tar -zcvf archive.tar.gz directory/
//This will tell tar to c (create) an archive from the files in directory (tar is recursive by default),
//compress it using the z (gzip) algorithm, store the output as a f (file) named archive.tar.gz,
//and v (verbosely) list all the files it adds to the archive.
//To decompress and unpack the archive into the current directory you would use
tar -zxvf archive.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment