Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to make a rar file(not tar or gzip) with several parts in linux shell, how can do that please?

for example my file is : m.avi - 500mb

I want this :

m.part1.rar 250mb
m.part2.rar 250mb  
share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

Ah I misunderstood, for parting rar files you have to do the following. First make sure you have rar installed. Then use the following command:

rar a -v250000k /path/m.splitted.rar /path/m.avi

a for append, -v for the size in kilobytes. This would create /path/m.splitted.part001.rar, /path/m.splitted.part002.rar, etc.

If you want the old naming scheme (m.splitted.rar as the first file, then m.splitted.r01, m.splitted.r02, etc.) you should use -vn instead of -v. See /usr/share/doc/rar/rar.txt for more information.

share|improve this answer
    
You can write volume size as Megabyte with M. I mean using rar -a -v250M ... –  SuB Oct 17 '13 at 15:16
add comment

There is a command for that. It can split any file, including rar. In your example, you would you the following command:

split -b 250MB -d /path/m.avi /path/m.part.

This would output 2 files of 250MB, called /path/m.part.01 and /path/m/part.02. You can specify any size with -b and use -d for numeric parts.

If you want to bring back the original, one would simply type:

cat /path/m.part.* > /path/new.avi

(Btw: if you want to do this for textfiles it is sometimes better to use the number of lines instead of number of bytes for splitting. Use -l instead of -b.

share|improve this answer
    
thnx but I want to make a rar file,then I must send it to a windows system. –  Sam Mar 4 '12 at 18:04
2  
Please delete your answer if it's obsolete. Don't add multiple answers to the same questions. You can always edit them. –  slhck Mar 4 '12 at 19:20
    
This doesn't seem to work with .avi files unfortunately. –  Korvin Szanto Dec 28 '12 at 5:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.