😇How to Open, Extract and Create RAR Files in Linux full (oke)
https://www.tecmint.com/how-to-open-extract-and-create-rar-files-in-linux/
Last updated
https://www.tecmint.com/how-to-open-extract-and-create-rar-files-in-linux/
Last updated
Ravi SaiveJuly 5, 2022 CategoriesCentOS, Fedora, Linux Distros, Open Source, RedHat 24 Comments
RAR is the most popular tool for creating and extracting compressed archive (.rar)
files. When we download an archive file from the web, we required a rar tool to extract them.
RAR is available freely under Windows operating systems to handle compressed files, but unfortunately, rar tool doesn’t pre-installed under Linux systems.
This article explains how to install unrar and rar command-line tools using official binary tar files under Linux systems to open, extract, uncompress or unrar an archive file.
Step 1: How to Install Unrar in Linux
On Debian and Ubuntu-based distributions, you can easily install unrar package using the apt-get or apt program as shown.
If you are using RHEL-based distributions, you can use the dnf command or yum command to install it.
If you are using other distributions, you need to download the latest unrar/rar file and install it using the following commands.
Step 2: How to Open/Extract a RAR File in Linux
To open/extract a RAR file in the current working directory, just use the following command with unrar e option.
To open/extract a RAR file in a specific path or destination directory, just use the unrar e option, it will extract all the files in the specified destination directory.
To open/extract a RAR file with its original directory structure, just issue the below command with unrar x option. It will extract according to their folder structure see below the output of the command.
Step 3: How to List a RAR File in Linux
To list files inside an archive file use unrar l option. It will display the list of files with their sizes, date, time, and permissions.
Step 4: How to Test a RAR File in Linux
To test an integrity of an archive file, use option unrar t. The below command will perform a complete integrity check for each file and displays the status of the file.
The unrar command is used to extract, list, or test archive files only. It has no option for creating RAR files under Linux. So, here we need to install RAR command-line utility to create archive files.
Step 5: How to Install Rar in Linux
To install the RAR command option in Linux, just execute the following command.
Sample Output
Step 6: How to Create Rar File in Linux
To create an archive (RAR) file in Linux, run the following command with rar a option. It will create an archive file for a tecmint directory.
Step 7: How to Delete files from the Archive
To delete a file from an archive file, run the command.
Step 8: How to Recover Archives
To recover or fix an archive file or files, run the command with option rar r.
Step 9: How to Update Archives
To update or add files to the existing archive file, use the following command with the option rar u.
Now, verify that the file tecmint.sql is added to the archive file.
Step 10: How to Set Password to Archives
This is a very interesting feature of the Rar tool, it allows us to set a password to the archive files. To password protect archive files use option rar a -p.
Now verify it by extracting the archive file and see whether it will prompt us to enter a password that we have set above.
Step 11: How to Lock Archives
Another interesting lock feature from rar tool, it provides an option to lock a particular archive file after extracting it.
Conclusion
For more RAR and Unrar options and usage, run the following command it will display a list of options with their description.
We have presented almost all of the options above for rar and unrar commands with their examples. If you feel that we’ve missed anything in this list and you would like us to add, please update us using the comment form below.
TagsCommandline ToolsPost navigationHow to Install Fedora 36 Server with ScreenshotsMonitorix – A Linux System and Network Monitoring Tool
Tutorial Feedback...
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
How to Install Yii PHP Framework on RHEL, CentOS, Rocky and AlmaLinux
How to Install Nagios Monitoring in RHEL, Rocky, and AlmaLinux
How to Synchronize Time with Chrony NTP in Linux
How to Configure FirewallD in RHEL-based Distributions
How to Install EPEL Repository on RHEL, Rocky & AlmaLinux
How to Fix Error: Failed to Download Metadata for Repo ‘AppStream’
2020-Nov update: sudo apt-get install rar Reading package lists… Done Building dependency tree Reading state information… Done Package rar is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
I’m a bit of a noob and was trying to compress a large Directory of files to smaller archive volumes of about 200mb with a comment included from file and this is what I came up with, please feel free to refine My command.:
rar a -z/Location of comment file/COMMENT.txt -v2048M -vn -m5 archivename.ra DirectorNameOfSourceFiles
I recognized My mistakes I think and ended up using the following:
rar a -m5 -v204800k -vn -z/LocationOfComment/COMMENT.txt ArchiveName.rar SourceDirectory
Any input would be very valuable TY
I have been trying to unrar a partitioned ISO file I downloaded recently, what is the command to not only unrar the first file but the other partitions so that it all decompresses consecutively?
It has 6 parts in all.
Was this article helpful? If you don't find this article helpful or found some outdated info, issue or a typo, do post your valuable feedback or suggestions in the comments to help improve this article...
Ravi SaiveNovember 26, 2020 at 10:06 am
ikomradJune 8, 2022 at 9:16 am
KhalequzzamanJuly 3, 2020 at 4:13 pm
NeophobiADecember 27, 2019 at 6:24 am
NeophobiADecember 27, 2019 at 6:58 am
Tri Bintang UtamaDecember 17, 2019 at 2:36 pm
Ravi SaiveDecember 18, 2019 at 11:25 am