7zip ubuntu

7zip is a versatile open source file archiver that uses the high compression 7z archive format, but also supports many others including ZIP, GZIP, BZIP2, TAR, WIM, XZ for both packing and unpacking, and even more for just unpacking such as RAR, ARJ, CAB, DEB, DMG, MSI, RPM and others. Check out the 7zip web site for more information.

Install 7Zip

7Zip is available for Ubuntu, and Linux in general in form of p7zip, which is a cross-platform version of the program. It is readily available for install from Ubuntu repositories using the Ubuntu Software Center or the APT tool. You can also install 7zip-rar to include RAR support in 7Zip.

Therefore, to install 7zip in Ubuntu simply search for it in the Ubuntu Software Center and install from there. If you want 7zip-rar tick the “Non-free rar module for p7zip (p7zip-rar)” checkbox from Optional add-ons.

To install both packages quickly from the command line just open the Terminal and run the following APT command:

sudo apt-get install p7zip-full p7zip-rar

That’s all there is to it! Now you can use 7zip to package and unpackage files and folders using both command line tools 7z and 7za, and graphical tools like Ark, File Roller, and even the Nautilus File Manager.

Using 7Zip

To compress an archive of files and folders with 7Zip into a .7z compressed archive run the following command:

7z a pictures.7z Pictures/

In this example we compressed the Pictures folder into a pictures.7z archive. The “a” function stands for “add” or “archive” for adding specified files to the archive. We can also specify an absolute path to files and folders we want to compress by replacing Pictures/ above with, for example, /mnt/data/Pictures/.

We can also use 7z to compress folders into an archive of a different type, such as ZIP, by passing a -t switch followed immediately by the archive type. To create a pictures.zip we would then run the following:

7z a -tzip pictures.zip Pictures/

To unpack the archive to a specified location we would use the “e” function, which stands for “extract”, like this:

7z e pictures.7z

This would extract files and folders to the current directory we are in.

Of course, you don’t need to use the command line to compress and extract files with 7zip. Having it installed in Ubuntu automatically integrates it with Nautilus, the Ubuntu’s File Manager, which allows you to seamlessly extract 7z and other archives by just right clicking on it and choosing “Extract here”.

To compress files and folders just select them, right click, and choose “Compress…”. A dialog will open that allows you to select 7z as the format, among many others.

Besides Nautilus having 7Zip installed also adds 7Zip support to other archiving tools such as File Roller and ARK so they can be used as normal to handle 7z archives, and others supported by it.




Ubuntu rar

RAR is a popular proprietary file format and software for compressing and archiving files, known for its ability to span multiple RAR files into a single archive, which is useful for compressing, archiving, and transferring large files.

Linux, including Ubuntu, has had RAR support for some time, but due to RAR’s proprietary licensing and restrictions support comes through multiple programs. Luckily all of them are easy to install, and if you don’t particularly care for the license you might just want to install them all in one go, especially unrar-nonfree and rar, and enjoy complete support for all RAR files, and all operations it allows you to do.

The following are the relevant programs and what they support, by their package names:

  • unrar-free – opens some .rar files, does not support RAR v3.
  • unrar-nonfree – opens all RAR files.
  • unar – an alternative option with full RAR support
  • 7zip – supports opening and extracting rar files
  • rar – a program for both creating and extracting rar archives

That about sums up what we’ve got, in addition to graphical archiving applications that use the support of some of these programs to handle rar files, among others.

Now let’s try to keep it simple. If you just want the ability to open and extract all rar files, and also easily create rar archives then install unrar-nonfree and rar using the Ubuntu Software Center or with these simple apt-get command:

sudo apt-get install unrar-nonfree rar

With this stuff behind the scenes your Ubuntu can now do anything you want with rar files, right from the File Manager itself. Just right-click on any .rar file and choose “Extract..” and you’re done. Or if you want to compress some files just select them, right click, and choose “Compress…”. Then pick .rar from the list of formats and click “Create”. You can then also use File Roller, Ark, and similar programs with rar files as well.

If you prefer to decompress with the command line here are a few basic examples to get you started. To extract an existing .rar archive run the rar command with the “e” function, which stands for “extract”:

rar e pictures.rar

You can also use the unrar command the same way:

unrar e pictures.rar

To create a new archive run rar with the “a” function, standing for “add” or “archive”, like this:

rar a pictures.rar Pictures/

You can also add multiple files into the archive:

rar a pictures.rar picture1.jpg picture2.jpg picture3.jpg

And just to make things slightly more interesting here’s how to create multipart rar archives, those that take the original big file and compress it into multiple .part01.rar, .part02.rar etc. files.

rar a -v50M movie.rar movie.mp4

The “-v50M” tells rar that each rar part will be 50 megabytes in size. You can put any size here. For example if you want 5 MB for each part you would type “-v5M” instead. Extracting these files works the same way as extracting any other archive except you have to extract the first part, the .part01.rar, like this:

rar e movie.part01.rar

It will then take data from all the parts and put it together into the original file.

For more information you can consult the manual pages for rar by running man rar. Don’t mind it saying “this is a trial version”. It’s the same kind of perpetual trial as WinRAR on Windows.

And that’s how you roll with rar on Ubuntu.




Linux pause process

Linux allows you to pause a running process rather than quitting or killing it. Pausing a process just suspends all of its operation so it stops using any of your processor power even while it still resides in memory.

This may be useful when you want to run some sort of a processor intensive task, but don’t wish to completely terminate another process you may have running. Pausing it would free up valuable processing time while you need it, and then continue it afterwards.

To pause a process in Linux we first need to obtain it’s PID, or Process ID number. There are various ways of getting the PID, and here are two. The simplest is the pidof command with the name of the program you wish to pause:

pidof totem

Another way is to use a ps command and search through the results for the program name:

ps aux | grep totem

In this command ps aux lists all of the processes, the pipe sign tells it to filter by the next command (so called piping), and the next command, which is grep totem, searches through the results to display only those mentioning the totem process. The first number in the results should be your PID.

Once you have your process ID you can pause this process by running the kill command with the -STOP option followed by the PID number:

kill -STOP 10463

Of course, the above number is just an example. Replace it with your own. In this example the above command will stop Totem from running.

Totem is a nice example to try out because you can see the immediate effect if you’re playing a movie in it. The movie will stop the moment you run this command. This isn’t the same as pressing the “pause” button in the player controls, because the whole process is completely suspended, not just the playing of a movie. You can see this by trying to press any of the control buttons; they wont respond. The program is frozen, even though you can still move its window.

To continue the process just run the kill command with the -CONT option and your PID:

kill -CONT 10463

If you’ve been playing a movie in Totem, as per this example, your movie would immediately proceed and the button controls in it will work as normal.

And that’s how you pause and continue processes in Linux!