Skip to content
Menu
Ryan and Debi & Toren
  • highpoints
  • Privacy Policy
  • R
  • tech
  • Where I’ve Been
Ryan and Debi & Toren

Linux – Bulk UnRAR

Posted on November 21, 2020November 21, 2020

If you’re not familiar with RAR files, they are like ZIP files. RAR is an archive format.

I had a collection of more than 150 RAR files in a single folder I needed to unrar (that is, open and extract from the archive). Doing them one at a time via KDE’s Ark software would work, but it would have taken a long time. Why spend that much time when I could automate the process.

Enter a loop bash script in KDE’s Konsole:

for i in *.rar; do unrar x "$i"; done

Here’s how the command works. The “for i in” part starts the loop (note: you can use any letter here). The “*.rar” component indicates that we want the loop to run through all the RAR files in the directory, regardless of the name of the file. The “do” command tells the loop what command to run. The “unrar x “$i”” component tells the software to use the unrar function which unpacks the archive. The “x” in that command tells the software to use the directory structure inside the RAR archive. The final piece of the loop after the second semi-colon – “done” – indicates what the terminal should do once the loop completes.

It took about 20 minutes to run through all the RAR files, but I used that time to create this tutorial. Doing this by hand would have taken me hours.

 4,423 total views,  4 views today

2 thoughts on “Linux – Bulk UnRAR”

  1. vijay says:
    December 11, 2020 at 11:14 am

    Hi,
    Thank you for this information post sharing with us, keep posting and share usefull knowledge with us..

    Reply
  2. Wake8 says:
    June 20, 2021 at 3:20 pm

    Option could also be unp “unpack (almost) everything with one command”. (available at least for Arch, Debian, Ubuntu)

    https://tracker.debian.org/pkg/unp (“Homepage”)
    https://man.archlinux.org/man/community/unp/unp.1.en

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • advice
  • country highpoints
  • funny stuff
  • general news
  • hiking
  • memories
  • movie reviews
  • opinions
  • other
  • politics
  • R
  • religion
  • sociology
  • state highpoints
  • stories
  • technology
  • Toren
  • travel
  • website feedback
©2023 Ryan and Debi & Toren | WordPress Theme by Superbthemes.com