This site contains affiliate links. If you make a purchase, we may earn a commission.

How To Extract RAR Files Using Command Line (6 Methods)

Ezriah Zippernowsky
September 13 2023


Hello, fellow primates! Welcome back to the jungle of archive files. If you’re going bananas over big RAR files, let’s peel them open for you! Using the command line to extract RAR files is as easy as peeling a banana. So, let’s stop monkeying around and get started!

Table of contents

Video guide showing how to extract rar files on the command line (terminal).

How To Extract RAR Files Using Command Line

Extracting RAR files on Linux is just as easy. Here’s how you do it:

  1. Install UnRAR: First, you need to install UnRAR. It’s like getting the right tool to peel your banana. Follow the installation instructions below.

     
    On MacOS type the following command into terminal (you will need Homebrew installed on your system): brew install rar

    On Linux:
    sudo apt-get install unrar How To Extract RAR Files Using Command Line on Linux: Step 1 How To Extract RAR Files Using Command Line on Linux: Step 1 How To Extract RAR Files Using Command Line on Linux: Step 1

  2. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To Extract RAR Files Using Command Line on Linux: Step 2

  3. Extract Command: Type

    unrar x yourfile.rar

    This is the magic spell that peels the banana. Replace ‘yourfile’ with the name of the RAR file you want to extract.

    How To Extract RAR Files Using Command Line on Linux: Step 3 How To Extract RAR Files Using Command Line on Linux: Step 3

How To Extract RAR Files Recursively Using Command Line

Got a whole tree of RAR files to extract? No problem!

  1. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To Extract RAR Files Recursively Using Command Line: Step 1

  2. Extract Command: Type

    unrar x -r yourfile.rar

    The -r switch is the magic spell that extracts all the files in your RAR file and its subfolders.

    How To Extract RAR Files Recursively Using Command Line: Step 2How To Extract RAR Files Recursively Using Command Line: Step 2

How To Extract Files to a Different Folder Using Command Line

Want to peel your banana in a different tree? Here’s how you do it:

  1. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To Extract Files to a Different Folder Using Command Line: Step 1

  2. Extract Command: Type

    unrar x yourfile.rar /path/to/directory

    The /path/to/directory is the magic spell that peels your banana in a different tree.

    How To Extract Files to a Different Folder Using Command Line: Step 2How To Extract Files to a Different Folder Using Command Line: Step 2

How To List Contents of a RAR File Without Extracting Using Command Line

Want to count your bananas without peeling them? Here’s how you do it:

  1. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To List Contents of a RAR File Without Extracting Using Command Line: Step 1

  2. List Command: Type

    unrar l yourfile.rar

    This is the magic spell that lets you count your bananas without peeling them.

    How To List Contents of a RAR File Without Extracting Using Command Line: Step 2How To List Contents of a RAR File Without Extracting Using Command Line: Step 2

How To Extract a Specific File from a RAR File Using Command Line

Need just one banana from the bunch? Here’s how you do it:

  1. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To Extract a Specific File from a RAR File Using Command Line: Step 1

  2. Extract Command: Type

    unrar e yourfile.rar yourspecificfile

    Replace ‘yourspecificfile’ with the name of the file you want to extract. This is the magic spell that gets you just the banana you want.

    How To Extract a Specific File from a RAR File Using Command Line: Step 2 How To Extract a Specific File from a RAR File Using Command Line: Step 2

How To Extract Multi-Part RAR Files Using Command Line

Got a big bunch of bananas split into multiple parts? Here’s how you extract them:

  1. Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.

    How To Extract Multi-Part RAR Files Using Command Line: Step 1

  2. Extract Command: Type

    unrar x yourfile.part1.rar

    This is the magic spell that gathers all the parts of your banana bunch and extracts them.

    How To Extract Multi-Part RAR Files Using Command Line: Step 2 How To Extract Multi-Part RAR Files Using Command Line: Step 2

    Remember, with the command line, you’re the master of the jungle! Happy unrarring!