Bash Wiki
Posts (Latest 30 updated) :
Read all
Contents:
  1. [Linux] Bash unrar Uso: Extract files from RAR archives
    1. Overview
    2. Usage
    3. Common Options
    4. Common Examples
    5. Tips

[Linux] Bash unrar Uso: Extract files from RAR archives

Overview

The unrar command is a utility used to extract files from RAR archives. It allows users to decompress and access the contents of RAR files, which are commonly used for file compression and packaging.

Usage

The basic syntax of the unrar command is as follows:

unrar [options] [arguments]

Common Options

  • x : Extract files with full path.
  • e : Extract files to the current directory without restoring the directory structure.
  • l : List the contents of the RAR archive.
  • t : Test the integrity of the files in the archive.
  • v : Verbose mode; provides detailed output during extraction.

Common Examples

Here are some practical examples of how to use the unrar command:

  1. Extract files with full path:
    unrar x archive.rar
    
  2. Extract files to the current directory:
    unrar e archive.rar
    
  3. List the contents of a RAR archive:
    unrar l archive.rar
    
  4. Test the integrity of the files in the archive:
    unrar t archive.rar
    
  5. Extract a specific file from the archive:
    unrar x archive.rar specificfile.txt
    

Tips

  • Always check the integrity of your RAR files using the t option before extraction to avoid data loss.
  • Use the l option to preview the contents of the archive before extracting, especially if you’re unsure of its contents.
  • If you frequently work with RAR files, consider adding unrar to your system’s PATH for easier access.