How to extract RAR Files on Linux

Configurare noua (How To)

Situatie

Solutie

The rar command lets you create an archive. To extract an existing RAR file, you use the unrar command. The syntax is pretty simple. Let’s use unrar to extract files from the archive we created earlier. To do that, run:

unrar e test.rar

The “e” flag tells the system to extract files to the current directory. Then, you input the RAR file name.

How to Extract RAR Files to a Specific Directory

What if you don’t want to extract the files to the current directory and instead need them in a different directory? You can easily accomplish that by adding the directory path to the previous command, like this:

unrar e test.rar /home/zunaid/rar/extract

Remember that the directory where you want to extract the archive must already exist on your system. Otherwise, the command won’t work.

Extract RAR Files and List the Directory Structure

Suppose you have several directories in your archive. If you extract it using the normal method, you can only see the files that were extracted. However, the “x” option from the unrar command lets you see the directory structure as well. That is, you can see which file is inside which directory in the archive. Let’s see that in action.

unrar x Files.rar

As you can see, the output includes the directories in the RAR archive and the files each folder contains. So if you have directories in your RAR file, extracting archives using the “x” option can be more helpful.

Tip solutie

Permanent

Voteaza

(5 din 11 persoane apreciaza acest articol)

Despre Autor