Download Article
A step-by-step guide to extracting RAR files on Ubuntu, Debian, and more
Download Article
If you want to open a RAR file on Linux, it's easy—you'll just need to use the Unrar command. While most Linux distributions, including Ubuntu, don't come with Unrar, you can easily install it using your distro's package manager. Once installed, use the command unrar x <filename> to extract all files and directories from the RAR archive. This wikiHow article will teach you how to unrar files on Linux using the Unrar command.
Things You Should Know
- You can usually install Unrar using your Linux distribution's package manager. On Ubuntu, use sudo apt-get install unrar .
- To unrar files, use the command unrar x filename.rar.
- To unrar to a specific directory, use unrar x filename.rar /path/to/directory .
Steps
Section 2 of 2:
Using Unrar
-
Use unrar x filename.rar to unrar the file. When you use the x option, you'll preserve the directory structure (folders and subfolders) when extracting the files. [1] X Research source
- This command will extract all files and folders from the RAR file to the current directory. If you want to extract the files to a different directory, use unrar x filename.rar /path/to/directory .
- If the RAR file requires a password, you'll be prompted to enter it. Many RAR files are protected by passwords for security purposes.
-
Use unrar e filename.rar to extract files without preserving directories. If you want all files from the archive to be extracted to the same location instead of keeping the directory structure in which they were compressed, use this option. In most cases, it's better to use the x option instead.
- You can specify the directory you want to extract the file to with unrar e as well. E.g., unrar e myfile.rar /usr/local/bin
- If you have a RAR file that came with multiple parts (e.g., .rar, .rar.00, .rar.01), you'll only need to use the above command on the first file (the one ending in .rar). This will extract the files from the RAR's other parts.
-
Use unrar l filename.rar to list files and directories in the archive. If you want to see what's inside the RAR file before extracting the files, you can use this command to view the files and structure.
-
Use unrar t filename.rar to test the integrity of a file. This checks the structure of the RAR archive and displays the results.
Advertisement
Expert Q&A
Search
-
QuestionHow do I count files in a Linux directory?Blain Gunter is a Computer Repair Specialist and small business owner based in Bakersfield, California. He was first introduced to computers at the age of five and has over twenty years of experience in his field. He is both an IT consultant and computer repair technician and takes pride in his ability to troubleshoot anything. He works with hardware, software, Windows, macOS, GNU/Linux, and even vintage electronics.In Linux, you can utilize various commands to count files within a directory. One such command is 'ls,' and another is 'tree.' These commands not only display file information but can also provide a count of files within a directory. Additionally, the 'find' command can be employed for this purpose. For example, the 'find' command with the '-type f' option can list all files in a directory, and using 'wc -l' can count the total number of files.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
- If you are uncomfortable with the command line and are looking for a GUI RAR interface for your Linux installation, you can try out PeaZip . PeaZip works in GNOME and KDE and is available in DEB or RPM packages. You can download it from https://peazip.github.io/peazip-linux.html .Thanks
- RAR3 is the current version of the RAR format. It added the Advanced Encryption Standard with a 128-bit key length. It also supports files larger than 4 Gigabytes and Unicode names.Thanks
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement
About This Article
Thanks to all authors for creating a page that has been read 804,306 times.
Reader Success Stories
- "Method 2 was a great help. I'm pretty new to Linux OS, kind of new the unrar x, but had no idea that other options existed. Thumbs up!" ..." more
Advertisement