A common trait for many Linux programs is that they are designed for a specific purpose. One tool per job is a kind of mantra that software developers seem to strive for. While there are certainly programs that can do more than a single task (such as media players that can play audio, video, stream from the Web, download album art and more), there are other programs designed for a single purpose.
Typically this single-mindedness is a good thing, for both users and developers. It allows developers to focus all their time on making sure their program does one thing very well, as opposed to many things in acceptible fashion. For users, it means simpler programs that are (or at least should be) easier to use. Unfortunately for users, this often also means having to install and learn many different programs.
Take archives, for example. If you download a ZIP file, you decompress it by typing "unzip filename.zip" (without the quotes). If you've downloaded a program that was compressed with TAR, you'll generally need to type "tar -xvf filename.tar" at the least (there are more operations possible besides x,v and f). And there are other compression schemes, such as 7z, RAR, and more. While some are very similar in usage, others vary wildly.
So it's good that a program called UNP exists. UNP is "a shell frontend for uncompressing/unpacking tools" that makes dealing with different archiving programs a snap, and it's already in the Ubuntu software repositories, even if it isn't installed by default.
To install it, first open up the Terminal.
Next, type sudo apt-get install unp to install it.
Note: you may also want to install other archiving utilities at the same time. The more utilities installed on your computer, the more effective UNP will be. Some of these utilties are unace, cabextract, bzip2, p7zip and more. Some may already be installed, while others will not be.
Once installed, you can use UNP to decompress a huge variety of archives. For instance, on our test system, UNP supports p7zip, unace, binutils, arj, bzip2, cabextract, archmage, cpio, tnef, xdms, gzip, macutils, lha, lzip, lzma, lzop, unlzx, formail, mpack, ppmd, rar, tar (with bzip2, lzip, lzop, xz-utils, compress and gzip), sharutils, xz-utils, unzip and zoo.
Whew!
So, how does one use UNP? Simple. Let's say you've downloaded an email attachment that a friend zipped to save space.
Simply use the 'cd' command to change your working directory to the same one as the archive. In our example, the archive is on the Desktop, so cd Desktop/ is the correct command.
We could also use cd /home/username/Desktop/ if you want to use the full path.
Then, type unp filename to extract the archive. In our example, the archive is named photos.zip, so we typed unp photos.zip to extract it.
You can then view the output as the files inside the archive are extracted into the same directory structure as the original.
So, what if the archive had been in RAR format? Same command, except for the file extension.
And if it had been a TAR file, using GZip? Again, same command, with the different extension.
And therein lies the beauty of UNP. If UNP supports the format and you have the tools installed on your system, you only need to know the single command in order to unpack the archive.
Even better, UNP can extract multiple archives at once, even if they aren't the same format. For instance, you already have photos.zip on your Desktop, but then you get a new email wth photos-new.7z and you're now ready to extract them both. After opening the Terminal and using 'cd' to change to the Desktop, typing unp photos.zip photos-new.7z will extract both, one after the other.
And that's pretty much it. UNP is an incredibly simple program to use. While there are a couple other options you can read about by typing "man unp" into the Terminal (once you've installed it), for the most part, UNP is a single-command application. What could be better?
No comments:
Post a Comment