...making Linux just a little more fun!

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Knowledge Base | News Bytes -->

The Answer Gang

By Jim Dennis, Karl-Heinz Herrmann, Breen, Chris, and... (meet the Gang) ... the Editors of Linux Gazette... and You!

(?) hi howtoopen .tgz or all zip

From ronen

Answered By: Suramya Tomar, Ben Okopnik


howtoopen .tgz or all zip you now



(!) [Suramya] tar -zxf filename.tgz
unzip filename.zip
Next time try to be a bit more clearer in your request. It would make it easier for us to answer your question.
(!) [Ben] [ top-posting reversed so that time won't flow backwards. Suramya, please don't provide bad examples for our readers.  :) ]
Interestingly enough, earlier today Jimmy pointed me to a couple of sites in Hebrew that looked like translations of some LG articles - and beziqint.net is an ISP in Israel. Coincidence? Maybe...
guides.co.il and linmagazine.co.il -- Jimmy
In general, our foreign correspondents do a fine job of asking good questions; ronen, obviously, has missed on that count (I originally received his email at our "tag-kb" address, which is used for contacting the KnowledgeBase maintainer.) However, since his question is of broad interest to new Linux users, we'll let him off with a term in a chroot(1) jail and a careful reading of "Asking Questions of The Answer Gang" at http://linuxgazette.net/tag/ask-the-gang.html for future reference - and I'll see if we can make this into a useful exchange. (I'm feeling particularly pedantic today; as a net.friend once said, "it gets me chicks.")
So, to ask the question that ronen (theoretically) was trying to ask:


Hi there, Answer Gang! I'd like to know how to open .tgz and .zip files under Linux. The standard documents are confusing, searching the Internet gives me too many results, and I don't know where else to look. I'd appreciate your help.


Why, hi there, ronen! Nice of you to ask in such a clear, understandable, and polite manner and give me a chance to pontificate on the topic!
There are a number of ways to deal with compressed files in Linux. One that's probably easiest for the new user is to use Midnight Commander's "VFS" (Virtual File System) feature - you simply place the highlight on the name of the compressed file you want and press the 'Enter' key. This will let you look inside the file and copy out anything you want. The default VFS setup handles bzip, bzip2, gzip, compress, ar, zip, jar, xpi, zoo, lha, and arj compressed formats (assuming that you have the appropriate decompression software installed.) You can run Midnight Commander by typing "mc" at the command line, either in the console or in an xterm window if you're running X.
If you want to do it manually, typing the name of the appropriate decompressor (possibly followed by options) and the name of the file to decompress at the command line should do it - but beware of "file scatter", i.e., what happens when the person who created the file did not use a directory structure to contain all the files. These will now be scattered all over the directory into which you've decompressed them - usually the current one. In general, it's a Good Idea to list the files before decompressing the archive - or look into the file with Midnight Commander, as mentioned above - just so you know what to expect.
Some examples of listing syntax for various decompressors:
# Gzipped tar file
tar tzf file.tgz

# tar file compressed with bzip2
tar tjf file.tar.bz2

# zipfile
unzip -l file.zip

# ARJ file
unarj l file.arj
Typing the name of the decompression program followed by '-h' or '--help', just as is suggested at the very top of "Asking Questions of The Answer Gang" at (http://linuxgazette.net/tag/ask-the-gang.html), will show you the option list for that program.
You can also use one of several GUI decompression tools, such as "guitar" (cute name, eh?) which act somewhat similar to WinZip in Windows; you may find that environment to be more familiar and comfortable. Do realize, however, that you'll be missing out on a lot of the capabilities available at the command line; GUIs are cute, but the CLI is powerful.

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

Each TAG thread Copyright © its authors, 2005

Published in issue 110 of Linux Gazette January 2005

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Knowledge Base | News Bytes -->