7zip
unrar is freeware but rar is trial so I’ve choosen 7zip
sudo port install p7zip
7z a -t7z -v1g /path/to/archive.7z /path/to/folder_or_file -mx0
-t7z compression format is 7z
-v1g parts are 1GB
-mx0 compression level is 0
Extracting 7zip
7z x FileName.7z
If your archive is split into multiple volumes, specify the lowest numbered volume.
7z x FileName.7z.001
If you want to extract to another location simply add “-o” follow by that location to the end of the command:
7z x FileName.7z -o/home/user/Desktop/foldername
If you can’t extract because of ERROR: E_FAIL, there is not enough space.
command generator for p7zip (doesn’t work if path has spaces or tilda ~ is used)
unrar
you can also install unrar
sudo port install unrar
and rar from http://www.rarlab.com/ and do this
rar a -m5 -v5M -R myarchive /home/
rar – starts the program
a – tells program to add files to the archive
-m5 – determine the compression level (0-store (fast)…3-default…5-maximum(slow))
-v5M – determine the size of each file in split archive, in this example you get files with size 5MB (if you wanted files of 512kB size you would write -v512k)
myarchive – name of the archive you are creating
/home/ – is folder of the files you wish to add to the archive
more documentation
man rar
extract archive with
rar x myarchive.part01.rar