Loading...

Knowledge Base
Save up to  70% off.  Start your website today!

Compressed Files rar zip tar.gz

Our servers can compress to and extract .zip, .bz2, .gz, .tar, .tar.bz2 and .tar.gz files.

Our servers will allow you to upload .rar files, but note that RAR is a closed-source software that is NOT distributed with Linux and cannot normally be extracted via shell or the File Manager in cPanel.

This article discusses the following topics.

The video below demonstrates how to compress and decompress files using the File Manager in your cPanel.


How to extract a file

  1. Log in to cPanel.
  2. Click on the File Manager icon.

    cPanel File manager

  3. Select the file that you wish to extract. You can either click Extract in the top-right corner of the File Manager or right-click on the file you wish to extract.

    File extraction options

  4. Enter the directory where you want to extract the files.

    Extracted file directory

  5. Click on Extract File(s).

How to compress a file

  1. Log in to cPanel
  2. Click on the File Manager icon.

    cPanel File manager

  3. Select the file that you wish to compress.

    select files to compress

  4. Select your preferred file Compression Type.

    compression file types

  5. Enter the name of the compressed archive and click Compress File(s).
  6. Once done, a dialogue box will appear showing the Compression Results.

    file compresson results


Commands in extracting and compressing files via SSH

Before you get started, ensure that you already have set up your SSH access. If not, follow the instructions on this knowledgebase article: How Do I Get and Use SSH Access?

.zip Files

To extract:

user@server ~ $ unzip archive.zip

To compress:

user@server ~ $ zip -v zipfilename.zip file.ext

or

user@server ~ $ zip -v zipfilename.zip directory/*

 

.bz2 Files

To extract:

user@server ~ $ bunzip2 archive.bz2

To compress:

user@server ~ $ bzip2 file.ext

 

.gz files

To extract:

user@server ~ $ gzip -d archive.gz

To compress:

user@server ~ $ gzip file.ext

 

.tar Files

To extract:

user@server ~ $ tar -xvf archive.tar

To compress:

user@server ~ $ tar -cvf archive.tar file1.ext file2.ext directory/

 

.tar.bz2 Files

To extract:

user@server ~ $ tar -xvjf archive.tar.bz

To compress:

user@server ~ $ tar -cvjf file.tar.bz2 file1.ext file2.ext directory/

 

.tar.gz Files

To extract:

user@server ~ $ tar -xvzf archive.tar.gz

To compress:

user@server ~ $ tar -cvzf file.tar.gz file1.ext file2.ext directory/

Please note that these are the most basic forms of the commands and have many options that are possible. HostGator does not provide support for using these commands. However, to learn more about each command, you can type:

user@server ~ $ man <command>

Where <command> is the command you would like to learn more about, such as "tar" or "gzip."

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...