How to Open Rar File in Linux
-
Use
unrar
to Openrar
File in Linux -
Use the
unrar e
Command to Extract File Contents of arar
File in Linux -
Use
p7zip
to Openrar
File in Linux
A rar
file, also known as Roshal Archive Compressed, is a compressed file type containing multiple files and directories. Special programs are used to access and extract the contents of the rar
file.
In this article, we will explain how to extract the contents of the rar
file in Linux.
The tools required to open the rar
file may not be installed in Linux. Let’s explain how to install and use these tools for different distributions.
Use unrar
to Open rar
File in Linux
We can install the unrar
tool on Linux distributions with the following commands.
- Arch Linux/Manjaro
sudo pacman -S unrar
- Ubuntu/Debian
sudo apt-get install unrar
- Fedora
sudp dnf install unrar
Use the unrar e
Command to Extract File Contents of a rar
File in Linux
Use the unrar e
command to open a rar
file. Type the directory name to extract the file contents to a different directory.
unrar e test.rar /tmp
We can see that all the contents in the compressed file have been extracted to the specified directory.
Use the unrar l
Command to List File Contents of a rar
File in Linux
With the l
parameter, the file’s contents can be listed without extracting it.
unrar l test.rar
Use unrar t
Command to Test File Contents of a rar
File in Linux
With the t
parameter, we can test the integrity of the file contents.
unrar t test.rar
Use p7zip
to Open rar
File in Linux
We can install the p7zip
tool on Linux distributions with the following commands.
- Arch Linux / Manjaro
sudo pacman -S p7zip
- Ubuntu / Debian
sudo apt-get install p7zip
- Fedora / CentOS
sudo yum install p7zip
Use the 7z e
Command to Extract File Contents of a rar
File in Linux
Use the 7z e
command to open a rar
file. If you want to extract the file contents to a different directory, use the -o
flag with the directory name.
7z e test.rar -o/tmp
We can see that all the contents in the compressed file have been extracted to the specified directory.
Use the 7z l
Command to List File Contents of a rar
File in Linux
With the l
parameter, the file’s contents can be listed without extracting it.
7z l test.rar
Use the 7z t
Command to Test File Contents of a rar
File in Linux
With the t
parameter, we can test the integrity of the file contents.
7z t test.rar
Yahya Irmak has experience in full stack technologies such as Java, Spring Boot, JavaScript, CSS, HTML.
LinkedIn