In the following video-tutorial included in a series of videos for beginners, we are going to make a practical example of how to manage rar files from the terminal of our Linux operating system, in this case from Ubuntu.
The exercise is designed for beginners in this operating system, and following all the steps, we will get ourselves, first install the necessary packages to compress and decompress files in rare, and then through the Practical exercise zip and unzip them without any problem.
For this exercise to bear fruit, it is convenient that while we follow the video tutorial, we go doing the exercise ourselvesIn this way and with practice, we can best keep the concepts of what we are doing.
The variety of commands what are we going to use in this practical exerciseor are the following:
To install rar:
- sudo apt-get install rar
To install unrar:
- sudo apt-get install unrar
If this order will report some kind of problem, which happened to me, we will add at the end –Fix-missing remaining in this way:
- sudo apt-get install unrar --fix-missing
To compress files we will use the command:
- weird filename.rar files to include
- weird filename.rar *
With the first command we will add the files one by one, and with the second we will include All the files that are within the directory in which we are.
If what we want is to compress by adding a Password to the .rar file, we will add -p at the end of one of the two orders.
To decompress it will be as simple as using the command Unrar:
- unrar x rar_name.rar
- unrar x name_del_rar.rar path where we want to unzip it
With the first order we will unzip it in the directory that we are and with the second we will tell it the directory in which we want it to unzip.
Although it may seem like a mess, if you do the exercise yourself and see the video-tutorial created for this purpose, surely everything is much clearer, and in a couple of times that you repeat it, you will surely have the basic concepts very clear.
More information - Terminal for beginners: Video-tutorial I
8 comments, leave yours
Thank you very much it helped me a lot just to clarify that if we need to compress the content of a directory from another path, do it like this:
rar on behalf of rar.rar / home / user / photos / *
I used it to cbrs
Thank you very much for the tip, Francisco! One question, how to exclude certain files or directories that are inside the directory that I want to compress in .rar? I appreciate your answer, greetings!
The answer is somewhat late but it will serve whoever requires it. Within that same directory you must create the rar indicating which files it is going to compress, very similar if you did it graphically by marking the files with the CTRL or SHIFT key.
Thank you very much Francisco has helped me a lot because I tried to unzip a psp game without the terminal and it gave me the following: An error occurred while extracting the files.
Invalid PPmd sequence.
With the terminal I have been able to unzip it without problems.
excellent to start
thanks for the contribution ... 🙂
Excellent I solve the problem
For those who want to decompress a rar divided into several parts, for example: book.part1.rar, book.part2.rar, ... simply add an asterisk on the command line like this: unrar x book.part * .rar