Last Updated: 1/24/2105
This article applies to the following services:
- VPS (Linux only)
- Dedicated servers (Linux only)
You'll want to use the tar command to compress the directory (and everything below the directory)
For a firm understanding of what you are doing, it is good to understand the switches you are using.
-z = Compress archive using gzip program
-c = Create archive
-v = Verbose (i.e. display the progress while creating the archive)
-f = Archive file name
-x = Extract files
-C = Path to folder you want to extract the files to
An example of compressing a folder:
tar zcvf nameofcompressedfile.tar.gz /path/to/folder/compressthisfolder
An example of decompressing a folder:
NOTE: Make sure you are in the folder that you want to unpack the files into.
tar zvfz nameofcompressedfile.tar.gz
If you want to extract the files to a particular directory, you'll want to use the following command. (In this example, we will extract to /tmp
tar zvfz nameofcompressedfile.tar.gz -C /tmp
For a firm understanding of what you are doing, it is good to understand the switches you are using.
-z = Compress archive using gzip program
-c = Create archive
-v = Verbose (i.e. display the progress while creating the archive)
-f = Archive file name
-x = Extract files
-C = Path to folder you want to extract the files to
An example of compressing a folder:
tar zcvf nameofcompressedfile.tar.gz /path/to/folder/compressthisfolder
An example of decompressing a folder:
NOTE: Make sure you are in the folder that you want to unpack the files into.
tar zvfz nameofcompressedfile.tar.gz
If you want to extract the files to a particular directory, you'll want to use the following command. (In this example, we will extract to /tmp
tar zvfz nameofcompressedfile.tar.gz -C /tmp