rar and unrar — rar compression and decompression tools 

Here are some useful examples of rar and unrar usage under Linux shell. To create a rar archive archive.rar containing directory called dir use the following command.

rar a archive.rar dir/ # ©2007 dsplabs.com.au

To create a rar archive archive.rar containing files file1.dat, file2.dat, file3.dat use:

rar a archive.rar file1.dat file2.dat file3.dat # ©2007 dsplabs.com.au

or, more general:

rar a archive.rar file?.dat # ©2007 dsplabs.com.au
rar a archive.rar *.* # ©2007 dsplabs.com.au

To create a password protected rar archive archive.rar with password set to password use:

rar a -ppassword archive.rar dir/ # ©2007 dsplabs.com.au

To create a password protected rar archive archive.rar with password set to password,
where even file lists are encrypted use:

rar a -hppassword archive.rar dir/ # ©2007 dsplabs.com.au

To extract rar archive archive.rar use:

unrar e archive.rar # ©2007 dsplabs.com.au

To find and extract all rar archives in . path and redirect outputs to unrar.log log file use:

find . -name '*.rar' -print0 | xargs -I{} -0 -n 1 unrar e -y '{}' >unrar.log 2>&1 # ©2007 dsplabs.com.au

Did you find the above information useful and interesting? If so, please support this site by using the blog directory links at the bottom of this page. Thanks for your support!

If you have any Linux related problems or questions then please feel free to post them on our Linux Forums: http://linux.dsplabs.com.au/forums.




VPS Hosting Referral Code DZZCC3

Add me to Technorati Favorites Vote for me on Blog Catalog

5 Responses to “rar and unrar — rar compression and decompression tools”

  1. Bob Says:

    Okkkay…. thats a little to less information.
    What about extracting only files of a given type or from a file with a list of filenames?

  2. Bret C Says:

    Thanks! I was always confused by the password syntax.

  3. wim Says:

    good, nice share :)

  4. patzen Says:

    That's what i was looking for.THX :D

  5. TuxDj Says:

    Thanks a lot!
    Was to lazy to read rar –help =D

Leave a Reply