Kurinchi Blogger Scribbles …

Posts Tagged ‘Gunzip’

Apr 05

How to import mysql dump (.gz or .sql) into a database?

Last updated: April 6th, 2010

When moving mysql database from one server to another or, to test that the data backup works as expected we need to import mysql dump file in the testing environment.

Create the database (test-database) in the testing environment and identify the location of the .gz or .sql file.

If the mysql dump was a .gz file, you need to gunzip to uncompress the file by typing
$ gunzip mysqldump.sql.gz

This will uncompress the .gz file and will just store mysqldump.sql in the same location.

Apr 03

How to Compress, Uncompress to .gz, .bz2?

Last updated: April 6th, 2010

Tar (tape archive) does not compress files. They are used for grouping all files in a folder so that it can be transferred across locations. In order to compress the files, you need to use zip, gzip or bzip2 utilities.

gzip, bzip2 are file compression utilities and gunzip, bunzip2 are file uncompression utilities.

bzip2 compresses files to a smaller size compared to gzip, but it takes longer to compress the files. Bzip2 uses Burrows-Wheeler block sorting text compression algorithm (with Huffman coding) and gzip uses Lempel-Ziv coding. so, a file compressed with one utility cannot be uncompressed with the other utility.

Apr 21

Gunzip, Bunzip, Unzip with tar

Last updated: April 6th, 2010

Bunzip, Unzip

To bunzip a folder, use the command

$ tar jcvf dump.tar.bz folder/

Transfer the file to the location of your choice. For e.g. /tmp and issue the following command to unzip

[/tmp] $ tar -jxvf dump.tar.bz

Valid HTML 4.01 Strict  Valid HTML 4.01 Strict