- How to create and open an archive with RAR on Ubuntu
- Installing rar package
- Creating archive file
- Showing the content of archive file
- Extracting archive file
- Creating and extracting password protected archive file
- About the author
- Fahmida Yesmin
- How to Extract RAR Files in Ubuntu 22.04
- How to Extract RAR Files in Ubuntu 22.04?
- Conclusion
- About the author
- Hammad Zahid
- Установите Winrar на Ubuntu
- 1- Установить WinRAR на Ubuntu
- 2- Использовать WinRAR на Ubuntu Desktop
- 3- Использовать WinRAR на Ubuntu Server
- View more Tutorials:
- How to Use RAR files in Ubuntu Linux [Quick Tip]
- Extracting RAR Files in Linux
- Step 1: Install unrar package from multiverse repository
- Step 2: Extract RAR files either graphically or via command line
- Creating & Managing RAR files in Linux
How to create and open an archive with RAR on Ubuntu
To compress, archive and transfer large files or folders, rar package can be used on Ubuntu. Rar is a common archiving software to compress large files or folders. Suppose, if you want to transfer a folder from one location to another location which contains many files and folders, then the first option is to compress the folder and create an archive file. The compress file can be easily attached with email or transferred to other location. Many options are available on Ubuntu to compress files or folders. But if the files and folders are compressed using rar command then the created rar file can also be extracted on windows. Because rar files are also supported by windows. How you can install and use rar package to compress or decompress files and folder is shown in this tutorial.
Installing rar package
Rar package is not installed on Ubuntu by default. So, run the following command to install rar on Ubuntu.
Rar package has various commands for creating archive files and folder. To get the list of rar commands just run rar without any command.
The following output shows that trial version of RAR 5.40 is installed on the system. You can use any command from the list with rar for the particular purpose. Use of some basic commands of rar are shown in this tutorial.
Creating archive file
Select any large file or folder to compress and create archive file using rar command. In the following example, code folder is selected to create the archive file. code folder contains 7 files and the size of code folder is 4096 bytes.
To add the file into archive, a command is used with rar and next type the name of rar file and the name of the file or folder that you want to compress. Run the command to create the archive file, code.rar file by compressing code folder.
After compression, the size of code.rar file is 1600 bytes. Run the following command to check the size of the code folder and the archive file.
Showing the content of archive file
Rar uses l command to show files and folder list of archive file. Run the following command to show the content of code.rar file.
Extracting archive file
Move code.rar folder in different location. Suppose, the archive file is moved in mydir folder. x command is used with rar to extract the archive file. Run the following command to extract the file in the current location. When code.rar file will extract then code folder will be created after extraction.
Now, run ls -la command to check the folder is created or not after extraction.
Creating and extracting password protected archive file
To create password protected archive, rar uses -p option with a command. After running the command, you have to set the same password for two times to create password protected archive file. The following command will create password protected archive file, pcode.rar of the folder code.
Now, if you want to extract pcode.rar file then it will ask for the password which is set during the archive file creation. After setting the password, type a to use current password for all files and folders of the archive file.
The above command shows the mostly used commands of rar to create and extract any archive file. There are many other uses of rar, such as, recovering archive, updating archive, locking archive, setting archive comments, deleting archive etc.
About the author
Fahmida Yesmin
I am a trainer of web programming courses. I like to write article or tutorial on various IT topics. I have a YouTube channel where many types of tutorials based on Ubuntu, Windows, Word, Excel, WordPress, Magento, Laravel etc. are published: Tutorials4u Help.
How to Extract RAR Files in Ubuntu 22.04
The RAR (Roshal Archive Compressed file) is a compressed form of the WinRAR archive and can be used to compress the files, to compress their size so they can be sent easily through email. The utility of the RAR file by default comes in Microsoft Windows, but in Ubuntu, to extract the files from the RAR files, we have to install some third-party applications.
In this write-up, a method has been discovered to extract the files on Ubuntu 22.04 using the command-line interface.
How to Extract RAR Files in Ubuntu 22.04?
The RAR files are the compressed files as discussed above and contain the “rar” extension with their names. To extract them in Ubuntu, a package of unrar will be installed using the command:
When the installation is complete, it’s time to learn the usage of the unrar package to extract the RAR files. For this, we have a RAR sample file for a better understanding of the user; navigate to the folder of “rar files” using the command:
List down the files of “rar files” directory by executing the command:
A “sample.rar” is available that can be extracted using the unrar package. To view the contents inside the rar file using the unrar utility, run the command:
To extract all these files in the same directory using the unrar utility, run the command:
In the above output, it can be seen that the files of sample.rar have been extracted using the unrar package. We used the “e” command of the unrar utility, which extracts the files without their archived path. Similarly, there are some other commands of unrar utility that can be found out by running the command:
All options of the unrar utility will be displayed on the screen.
Conclusion
Installing the unrar utility on Ubuntu and by running the command “unrar e filename.rar”, RAR files can be extracted in Ubuntu 22.04. In this write-up, the installation method of unrar and its usage has been explained with the help of an example.
About the author
Hammad Zahid
I’m an Engineering graduate and my passion for IT has brought me to Linux. Now here I’m learning and sharing my knowledge with the world.
Установите Winrar на Ubuntu
Следуйте за нами на нашей фан-странице, чтобы получать уведомления каждый раз, когда появляются новые статьи. Facebook
1- Установить WinRAR на Ubuntu
WinRAR — без сомнений, это самый популярный инструмент использующийся для сжатия и извлечения файлов. Он работает с большинством форматами сжатия.
Установка WinRAR на Ubuntu (Linux) это очень просто, вам просто нужно выполнить две команды ниже:
sudo apt-get update -y sudo apt-get install -y xarchiver sudo apt-get install aptitude sudo aptitude update sudo aptitude install rar unrar
2- Использовать WinRAR на Ubuntu Desktop
На рисунке ниже показано, как использовать WinRAR после того, как он установлен на Ubuntu Desktop
3- Использовать WinRAR на Ubuntu Server
На рисунке ниже показано, как использовать WinRAR после того, как он установлен на Ubuntu Server.
View more Tutorials:
Это онлайн курс вне вебсайта o7planning, который мы представляем, он включает бесплатные курсы или курсы со скидкой.
- Getting really good at JavaScript and TypeScript
- Complete E-Commerce Course — Java,Spring,Hibernate and MySQL
- AWS Serverless APIs & Apps — A Complete Introduction
- Administering Microsoft SQL Server 2012 Databases — 70-462
- Struts 2 Framework for Beginners
- Flutter & Firebase: Build a Complete App for iOS & Android
- Learning Dart: Become more productive with Dart
- SQL in an Hour with PostgreSQL
- For Free — Deploy Quickly Spring Boot on Heroku With MySQL
- JQuery Create Overlay Popups from scratch using Jquery
- The Complete Flutter App Development Course for Android, iOS
- Projects in Bootstrap 4: Learn by Building Apps
- Create Complete Web Applications easily with APEX 5
- * * C++, Short and Sweet, Part 1
- CSS3 MasterClass — Transformations And Animations
- Learning React Reusable Components
- Build Outstanding Java Apps with JavaFX much faster
- AWS Mobile with Google Dart
- MongoDB: Learn Administration and Security in MongoDB
- Create Android and iOS App using HTML, CSS and JS
- Spring Boot Microservices with JPA
- Getting Started With Flutter 1.0
- Web Visualization with HTML5, CSS3, and JavaScript-Volume 1
- Distributed configuration with Spring Cloud Config
- Beast Android Development: Firebase Necessities
How to Use RAR files in Ubuntu Linux [Quick Tip]
RAR is a quite good archive file format. But, it isn’t the best when you’ve got 7-zip in Linux offering great compression ratios and Zip files being easily supported across multiple platforms by default.
It is one of the most popular archive formats, but, Ubuntu‘s archive manager does not support extracting RAR files nor does it let you create RAR files. It would rather show you this error:
There is no command installed for RAR archive files. Do you want to search for a command to open this file?
Fret not, we have a solution for you. To enable the support to extract RAR files, you need to install UNRAR – which is a freeware by RARLAB. And, to create and manage RAR files, you need to install RAR.
Extracting RAR Files in Linux
Unless you have it installed, extracting RAR files will show you an error “Extraction not performed“. Here’s how it should look like (Ubuntu 18.04):
If you want to resolve the error and easily be able to extract RAR files, follow the instructions below to install unrar.
Step 1: Install unrar package from multiverse repository
Launch the terminal and type in the following command to make sure you have multiverse repository enabled in Ubuntu:
sudo add-apt-repository multiverse
Now install unrar package:
sudo apt-get install unrar
Step 2: Extract RAR files either graphically or via command line
After installing unrar, you may choose to type in “unrar” (without the inverted commas) to know more about its usage and how to use RAR files with the help of it.
The most common usage would obviously be extracting the RAR file you have. So, you can either perform a right-click on the file and proceed to extract it from there or you can do it via the terminal with the help of this command:
You can see that in action here:
If the file isn’t present in the Home directory, then you have to navigate to the target folder by using the cd command in Linux. For instance, if you have the archive in the Music directory, simply type in “cd Music” to navigate to the location and then extract the RAR file.
Creating & Managing RAR files in Linux
UNRAR does not let you create RAR files. So, you need to install the RAR command-line tool to be able to create RAR archives.
To do that, you need to type in the following command:
Here, we will help you create a RAR file. In order to do that, follow the command syntax below:
rar a ArchiveName File_1 File_2 Dir_1 Dir_2
When you type a command in this format, it will add every item inside the directory to the archive. In either case, if you want specific files, just mention the exact name/path.
By default, the RAR files reside in HOME directory.
In the same way, you can update/manage the RAR files. Just type in a command using the following syntax:
rar u ArchiveName Filename
To get the list of commands for the RAR tool, just type “rar” in the terminal.
Wrapping Up
Now that you’ve known how to use RAR files on Ubuntu, will you prefer using it over 7-zip, Zip, or Tar.xz?
Let us know your thoughts in the comments below.