Command line for unpacking rar archives in Linux

Command line for unpacking rar archives in Linux


Command line for unpacking rar archives in Windows, using UnRAR.exe from WinRAR installation folder:
"full folder path where is located RAR utilities\UnRAR.exe" x -p"password" -o+ "full source folder path\file.part1.rar" "full destination folder path"\

Command line for unpacking rar archives in Linux (perhaps this method will also work in Mac OS X, with some adjustments for the direct download link and the file name):

In Linux, let's say your user name is merlin.
1. Install rar and unrar for Linux.
If rar and unrar are already installed, skip to the next step.
To install rar and unrar from terminal, you need to be logged in as 'root'.
Login as root in Linux:
Type the next commands one at a time in terminal and press ENTER.
Do not copy '# ' or '$ ' in the terminal.
$ sudo passwd root
Type the password for the current user and hit ENTER
Re-type the password for the current user and hit ENTER
$ su -
Type a password for 'root' and hit ENTER (in case you already used 'root', just type the password)
Re-type the password for 'root' and hit ENTER
Write down the newly created password for 'root', for future use.

Install rar and unrar for Linux, using the next commands in a terminal (one at a time).
Do not copy '# ' or '$ ' in the terminal.
# wget http://www.rarlab.com/rar/rarlinux-x64-5.2.1b2.tar.gz
If wget command above gives errors, go to http://www.rarlab.com/
check the direct download link for this package and if a newer version is released, modify the commands to download and install rar and unrar and the commands below to match the rar/unrar installer file name.
Direct download link for Mac OS X rar version(s) is(are) different, so check them on the site mentioned above and modify the commands.
Do not copy '# ' or '$ ' in the terminal.
# tar -zxvf rarlinux-x64-5.2.1b2.tar.gz
# cd rar
# make
# cd
# rm rarlinux-x64-5.2.1b2.tar.gz
# rm -rf rar
If you want to register rar (unrar doesn't need registration), copy your rarreg.key into this path: '/usr/local/lib'.

2. Unpack rar archives.
In order to unpack rar archives from terminal, you need to be logged in as 'root'.
If you are not already logged in as 'root', proceed as follows.
Login as root in Linux:
Type the next commands one at a time in terminal and press ENTER.
Do not copy '# ' or '$ ' in the terminal.
$ sudo passwd root
Type the password for the current user and hit ENTER
Re-type the password for the current user and hit ENTER
$ su -
Type a password for 'root' and hit ENTER (in case you already used 'root', just type the password)
Re-type the password for 'root' and hit ENTER
Write down the newly created password for 'root', for future use.
If your first archive from set is '2k3bb51eodrd84tzeh06.part1.rar', paste the next command in terminal to extract the archive content.
Do not copy '# ' or '$ ' in the terminal.
# '/home/merlin/rar/unrar' x -p'9720358461' -o+ '/home/merlin/u1/2k3bb51eodrd84tzeh06.part1.rar' '/home/merlin/u1/'
9720358461 being the rar password.
Your rar files will be extracted in this path: '/home/merlin/u1'
Switch back to 'merlin' user.
Do not copy '# ' or '$ ' in the terminal.
# su - merlin

No comments:

Post a Comment