Tag Archives: rar

The Quirks of 7zip Under Ubuntu

From time to time it becomes desirable to un-rar archives.  I mean, making archives is fun and all, but you’ve just got to go for broke once in a while and take something out of an archive.  On Windows and Apple Macs I use 7zip a lot.  Under Synaptic you will find a Unix version listed as p7zip.

Open Synaptic: System (menu) —> Administration —> Synaptic Package Manager

Click on the “Search” button and use 7zip as your search term.  There will be four results.  I installed all three of the p7zip items (p7zip, p7zip-full, & p7zip-rar).  You may do so by clicking each item’s box (to its left) and selecting “Mark for Installation” (if they already have a green box they are already installed).  Then click the “Apply” button and Synaptic will install these packages.

At this point you now have added 7zip functionality to the built-in Ubuntu Archive Manager.  Right-clicking a file or folder will allow you to create an archive as a 7z file, and double-clicking an archive file will allow you to dive into it and pull out any files you might need.

With one critical exception: Archive Manager cannot deal with multiple-file archives.  In this case you will have to head to the command line.  If you are less  comfortable you may find this form useful.  It will allow you to enter some information about the file and then hand you the exact line of code required.  However, the code required is simple enough, so let me just show you an example.

Open a terminal: Applications (menu) —> Accessories —> Terminal

To locate your archive three commands will come in handy: pwd, ls, & cd.  The first will print your current location: pwd.  The second will list the contents of the current location: ls.  And the third will allow you to change directories into a directory (folder) listed from ls: cd.  When using cd it is followed by a space and then the name of the folder into which you wish to change: cd Desktop.  If you type cd by itself you will be returned to your home directory (/home/[username]).  Using these commands, navigate into the folder with the archive you wish to open.

Once you have cd into the correct directory, you can get to using the unarchiving command.  For regular (single-file archives) your code would look something like this:

7z x [yourFileName].7z -o/home/[username]/Desktop

The parts in [brackets] are to be replaced by the name of the archive file and by your username.  So it might look like this when you run it:

7z x myArchive.7z -o/home/jimbo/Desktop

For the multiple-file archives, they usually un-rar out of the lowest numbered file (note the change in the file extension from the previous example):

7z x myArchive.r00 -o/home/[username]/Desktop

However, sometimes the lowest numbered file won’t be the correct one.  If the lowest numbered file yields a much smaller file or a dysfunctional file, look in the list to see if one of the files ends in .rar and use that one instead.

7z x myArchive.rar -o/home/[username]/Desktop

Happy hunting.

Share