Example advert

Using 7-Zip

../../Images/7zip.png
Windows only: This tutorial will show you how to create a compressed archive file, and how to extract the contents of a compressed archive file. The guide's choice of file compression and archiving utility is 7-Zip, an open source program, by Igor Pavlov.
If you haven't already downloaded and installed this program, the guide's article 7-Zip – File Compression and Archiving will show you what to do.

Creating a Compressed Archive File

The ZIP file format allows multiple files to be stored in hierarchical folders, exactly as you would normally store files on your hard disk. Additionally, of course, the files themselves can be compressed, so that less space is consumed.
The easiest way to create a compressed archive file, then, is to first create the folder hierarchy on your hard disk, and then add the top folder to the archive. All sub folders and files will then also be added.
Different Operating Systems
If you're going to send the archive to someone who uses a different operating system to your own, make sure that you only use letters and numbers for the folder and file names, since acceptable special characters (including spaces) varies between operating systems.
In the example I have used the Pragmatic Computer User's Guide folder on my computer. However, to make things a little more complex, there are two sub folders, html and web, which are generated, and I don't want to include these in the archive file.
There are essentially two ways you can quickly create the archive - using the contextual menu in Explorer, and using 7-Zip itself. In the image below, I used Explorer to first highlight the files and folders I wanted to archive, by left clicking on each item, but with the Ctrl key already pressed. Then, with the mouse cursor over one of the highlighted items, I right clicked to get the contextual menu. Then I chose 7-Zip and Add to archive...:
ImagesUsing7Zip/Compress-1.png
The following dialog is then displayed:
ImagesUsing7Zip/Compress-2.png
One of the nice features of 7-Zip is that it does a very good job of guessing most of the information in the first place. Since I used files and folders from the PragmaticComputerUsersGuide folder, it chose this as the archive filename.
You can change the archive format, compression level and method, to one of several provided by the program. I chose Zip because it is almost universally recognised on all operating systems. I also chose Maximum as I am more concerned with producing a small archive file, than the amount of time taken to produce it, and later to expand it.
Since this is the first time I am creating the archive, the Add and replace files update mode is the best choice. When using an existing archive, then the Synchronize files option is probably a better choice.
Don't add the archive to itself
If you keep the archive file in the same folder as the files being archived, as in this example, and then later update it, be very careful not to include it in the list of files to be archived – otherwise you'll get the old archive inside the updated archive.
Once the parameters have been set to your liking, click on OK. The compression process can take some time, especially if the number of files is large, or the files themselves are large. The dialog below is displayed, showing how much of the archive has been compressed:
ImagesUsing7Zip/Compress-3.png
When the dialog disappears, the archive file will have been completely created.
An alternative to using Explorer is to use 7-Zip itself. Launch the program as shown below:
ImagesUsing7Zip/Launch-1.jpg
Now move to the folder you wish to archive. You can type the folder address into the input box below the button bar, or double click on the folder names as you would in Explorer. Now highlight the required files and folders, using the same technique as for Explorer, explained above, then click on the Add button:
ImagesUsing7Zip/Compress-4.png
The same Add to archive dialog is then displayed as in the Explorer example above.

Extracting the Contents of a Compressed Archive File

Extracting the contents of a compressed archive file is also an easy task. For this example I will use the archive file that I created in the previous example. Use Explorer to move to the correct folder, then right click on the archive file to display the contextual menu, as shown below:
ImagesUsing7Zip/Extract-1.png
If you simply want to extract the entire contents of the archive file, either choose Extract files... or Extract Here. For this example I didn't want to extract the files in the same folder as the originals, so I chose Extract files..., and then changed the Extract to folder, thus:
ImagesUsing7Zip/Extract-2.png
Again, 7-Zip sets very sensible values for the Path mode and Overwrite mode properties, so all that remains to do is to click on OK. Since the extraction process can take some time, a progress dialog is displayed:
ImagesUsing7Zip/Extract-3.png
When the progress dialog disappears, the files and folders will have been extracted.
Check your Archive File
If you are sending an archive file which contains more than one file or folder, it is always a good idea to extract the archive yourself to a temporary folder, to check that all the required contents were added to the archive. It is very easy to forget an image or document which is referenced in another document – the result is that the receiver simply won't see what you intended.
There will also be occasions when you either want to see the archive contents before extracting the files, or that you need to extract only a portion of the archive file. In these cases, open the archive file in 7-Zip by right clicking on the archive filename within Explorer, then chose 7-Zip and Open archive:
ImagesUsing7Zip/Extract-4.png
Alternatively, if you have associated the archive file extension to 7-Zip, you can just double click on the archive filename. The following window is displayed:
ImagesUsing7Zip/Extract-5.png
7-Zip treats the archive file and its contents as if it were a normal sub folder. You can browse any of the archive file's contents, and then choose which files or folders you want to extract by highlighting them, and then clicking on the Extract button:
ImagesUsing7Zip/Extract-6.png
Here I decided to extract the entire contents, but I could have chosen to extract just the docs folder, for example, simply by only highlighting that folder. When you click on the Extract button, 7-Zip will ask you to specify the Copy to folder in the following dialog:
ImagesUsing7Zip/Extract-7.png
Again, I didn't want to extract the files in the same folder as the originals, so I changed the Copy to folder, and then clicked on OK. The usual progress dialog is displayed until all the files have been extracted, as before.

Conclusions

I don't think the user interface will win any design awards, but the program does an excellent job overall. Importantly, it can expand Linux tarball or tar and feathered archives (usually with a .tar, .tgz or .tar.gz extension.)
Make a Donation
If you find 7-Zip to be an important utility to you, think about making a donation to the developers.

Further Reading

From a pragmatic point of view, your best source is the help file (available in English only) that comes with the 7-Zip program. Launch 7-Zip then press F1.
The 7-Zip web site provides a links page, with links to tutorials at the bottom of the page.

AddThis Social Bookmarking  Valid CSS   Valid XHTML 1.0   Valid Atom 1.0   Atom 1.0 Feed

Example advert

Support the Guide