: TipsAndTricksFileCompression

Welcome :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

File compression


The commands below are ran in shell (terminal) so SSH access is required to use them. In the future this page may include compressing/archiving files using a programming language such as PHP or Ruby.

Our options

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

Learning to use

Within shell simply 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, feel free to google for them.

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 man page will show additional options and will explain these.

## zip a few files and directories, creates test.zip
zip test.zip test.txt images/ phone.txt

## unzipping all of the above into the current directory
unzip test.zip

## 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

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0493 seconds