Knowledgebase: Site Functions
File Compression Info
Posted by H9 Admin on 13 January 2015 04:21 PM

The commands below are run in Shell (Terminal), so SSH access, which is enabled on your account by default, is required to use them. In the future this page may include compressing/archiving files using a programming language such as PHP or Ruby.

Getting Dirty with Commands

The commands available on our servers typically include 'zip/unzip', 'tar', and 'bzip2/bunzip2', and 'gzip/gunzip'. An impressive array of options!

Within Shell type 'man command' , where command is one of the above. It will explain how to use and display the various options associated with the command. Also, many online resources (tutorials and articles) exist for your reference.

Example Uses

The most common Linux approach is to create .tar.gz files. Using zip is more common for Windows users, and Bzip2 use is increasing. Notice how with tar we are passing options c (create) or x (extract) along with z (gzip), v (verbose), and f (file) into tar. The main page will show additional options and will explain these.

  • zip a few files and directories, creates
    zip test.txt images/ phone.txt
  • unzipping all of the above into the current directory

  • ## gzipping and tarring a directory and file (common method)
    tar -czvf archive.tar.gz files/ hello.pdf

  • ## ungzipping/untarring the same file
    tar -xzvf archive.tar.gz

  • ## viewing the contents of a .tar.gz file
    tar -tzvf archive.tar.gz

(1 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
Help Desk Software by Kayako fusion