Linux / UNIX command to open .gz files

in Categories , , , , , , , , , last updated October 4, 2007

Q. I have download files from the Internet. Each file has .gz extension. How do I open .gz files under Linux?

A. You need to use gzip / gunzip program. It is a software application used for file compression. It is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered data compression algorithms

How do I extract a gz file?

Use guzip command as follows:
$ gunzip file.gz
$ gzip -d file.gz
To see new file, enter:
$ ls -l

How do I extract a tar.gz or .tgz file?

Files with extension tar.gz or .tgz are tar files compressed with gzip. On Unix system extract them with following command:
$ gunzip < file.tar.gz | tar xvf - $ gunzip < file.tgz | tar xvf -

If you have GNU tar (Linux system) you can use the z option directly:
$ tar xvzf file.tar.gz
$ tar xvzf file.tgz

How to install firefox-2.0.tar.gz in Linux

in Categories , , , , last updated June 17, 2008

Q. I have downloaded firefox file from mozilla web site to my Linux desktop system. The name of file is firefox-2.0.tar.gz. How do I install firefox-2.0.tar.gz in Fedora Core Linux? Please provide me step by step instructions for the same. What about my old bookmarks and add-ons. I am going to lose them?

A. Update: FireFox version 3.0 has been released and it is recommended that you install Firefox 3.0 under any Linux distribution.

Mozilla Firefox is a free, open source, cross-platform graphical web browser developed by the Mozilla Corporation and hundreds of volunteers. Installing Firefox 2 will overwrite your existing installation of Firefox. You won’t lose any of your bookmarks or browsing history, but some of your extensions and other add-ons might not work until updates for them are made available.

Installing firefox on Linux

Just use following instructions to download and install Firefox.

Download firefox to your Linux desktop

=> Visit this site to download firefox

Firefox 2.0 installation – Just untar file and install it

Let us say you would like to install firefox in your own home directory called /home/tom/firefox
$ mkdir /home/tom/firefox

Change directory:
$ cd /home/tom/firefox

Copy your files to /home/tom/firefox and untar it:

$ cp /home/tom/Desktop/firefox- .
$ tar -zxvf firefox-

And you are done. Start firefox:
$ /home/tom/firefox/firefox &

How do I install firefox for everyone?

Install Firefox in /opt directory. Login as root user:
# cd /opt
# mkdir firefox
# cd firefox
# cp /home/tom/Desktop/firefox- .
# tar -zxvf firefox-

To start firefox:
$ /opt/firefox/firefox &

You can also create a shortcut from your own desktop :)

What about my bookmarks and browsing history – Am I going to lose them?

You won’t lose any of your bookmarks or browsing history, but some of your extensions and other add-ons might not work until updates for them are made available.

Unpacking or uncompressing gz files under Linux and UNIX systems

in Categories , last updated January 17, 2008

Q. How do I open or uncompress .gz extension file under Linux or UNIX computer?

A. The .gz file extension are created using Gzip program which reduces the size of the named files using Lempel-Ziv coding (LZ77). gunzip / gzip is software application used for file compression. gzip is short for GNU zip; the program is a free software replacement for the compress program used in early Unix systems.

Each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modification times.

To expand i.e. to Unpacking or uncompressing gz files you need to use gunzip program Or gzip -d or zcat program:

Using gunzip command:
$ gunzip file.gz
$ ls file

Using gzip -d command:
$ gzip -d file.gz
$ ls file

If file extension is tar.gz, type the command:
$ tar -zxvf file.tar.gz
Please note that gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack programs.

See also: