Make a split rar archive (from the CLI)

Share your wisdom. Not for support questions!

Moderator: How-to Curator

Make a split rar archive (from the CLI)

Postby Hallvor » November 4th, 2011, 8:27 pm

This can be handy if you for some reason want to split files into several archives to the size of your liking.

First you need to install rar (non-free):

Code: Select all
aptitude install rar


Now we are ready to make the archive. Navigate to the directory your files are. Usage is as follows:

Code: Select all
rar a -m0 -v15M thenameofmyarchive fileIwanttoinclude1.avi fileIwanttoinclude2.pdf


rar - starts rar....
a - adds file(s) to the archive
-m0 - determines compression level (0=store ... 3=default ... 5=maximum)
-v15M - determines size of each split rar-file. 15M means 15 megabytes. (If you want something very small, e.g. 512kB, use -v512k)
thenameofmyarchive - output archive. (Do not add an extension. This will be added automatically.)
fileIwanttoinclude1.avi fileIwanttoinclude.pdf - the names of the files you want to add to the archive and split.

The files will be built and you will see output files that ends with thenameofmyarchive.part1.rar thenameofmyarchive.part2.rar, etc.

Extract them from the cli with
Code: Select all
rar x thenameofmyarchive.part1.rar
or with Ark or whatever you use for archives.

That's it.


Plagiarized from here:
http://ubuntuhowtos.com/howtos/create_split_rar_archive



Discussion is here: viewtopic.php?f=24&t=1475
Laptop: Intel Core i5 3210-M CPU @ 2.50 GHz, 16 GB RAM, Intel HD 4000 graphics, 128 GB SSD + 1 TB HDD, Debian Wheezy (KDE)
Media center/seedbox: Raspberry Pi, Raspbian (LXDE)
User avatar
Hallvor
 
Posts: 263
Joined: February 10th, 2011, 2:11 pm
Location: Kristiansand, Norway

Return to HowTo

Who is online

Users browsing this forum: No registered users and 2 guests

x