Tag Archive for 'tar gz'

How to: tar a file, gzip a file, untar a file quickly

TEST

I thought I’d share in case anybody else runs into the problem and needs to tar or gzip a file on their server.

Here’s how to tar and then how to gzip (compress) a file in SSH
When you are logged into SSH this command line should tar and then gzip your folder into a .tar.gz file. This will gzip your file into the current directory:
tar -czf whatever.tar.gz foldername
If you’d like to tar your file and have it put in another location use this:
tar -czf /directory/directory/whatever.tar.gz foldername

Here’s how to untar and how to ungzip (or unzip, uncompress) a file in SSH:
This will untar and uncompress your file, then it will place that folder in the directory you are currently in restoring your old folder and file structure:
gunzip -dc whatever.tar.gz | tar xvf -

Thank you, and good night.