tar and gzip files from linux command line

Sometimes it’s hard to rememeber all the options you need to include to tar and gzip files or a folder from the command line. Here it is…

tar -cvzf tarballname.tar.gz myfilestocompress

To untar and unzip simply do:

tar xvfz filename.tar.gz

And if there are only certain files you want in the tar then do:

tar xvzf filename.tar.gz */dir.you.want/*
  • http://makesomecode.com/2012/04/25/tar-and-gzip-files-from-linux-command-line/ wordpress services

    i read your blog about “tar and gzip files from linux command line”

    these commands are mostly useful for that user who use linux cammmand