
Using 7-Zip![]() 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 FileThe 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 SystemsIf 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...:
![]() The following dialog is then displayed:
![]() 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 itselfIf 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:
![]() 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:
![]() 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:
![]() The same Add to archive dialog is then displayed as in the Explorer example above.
Extracting the Contents of a Compressed Archive FileExtracting 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:
![]() 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:
![]() 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:
![]() When the progress dialog disappears, the files and folders will have been extracted.
Check your Archive FileIf 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:
![]() 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:
![]() 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:
![]() 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:
![]() 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.
ConclusionsI 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 DonationIf you find 7-Zip to be an important utility to you, think about making a donation to the developers.
Further ReadingFrom 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.
|
Guide Contents:
Tag cloud: |