Extracting rar files with Linux unar command
The rar file format is a proprietary data compression archive file format. Often I will end up comming accross this kind of archive file and would like to extract it in a Linux system without having to boot to windows, or by one means or another using winrar to do so. The good news here is that there is a popular linux deal that can be used to make quick work of this called unar. On the Debian based distros that I work with thus far it would seem that this is not backed into the OS image, however it can easly be added by way of apt.
Install unar by way of apt
How to go about installing unar if it is not there to begin with will as always deped on what distro you are using. I like to stick with debian based binary distros such as Debian, Ubuntu, and in late years Raspberry PI OS actaully. So then for me I have found that I can just add this one by the ushual apt install deal. However Often I will use the type command to see of a command is installed at all to begin with. After that I like to use the show sub command of apt to see of the command can be installed by way of apt, and if so what version.
|
|
Thus far I have found that I can just install unar by the typical suco apt install line.
|
|
Extract a file
The main reason why I installed unar is to extract sound font files that I would like to use with MuseScore. The files that I find are often in rar or some other compression format that I can not just extract with an out of the box install of what there is to work with. Anyway once unar is installed all I have to do is just type unar, and then pass the path to the rar file as the first positional argument. After that unar will do its magic and extract what it is that I am after.
|
|
So that works when it really comes down to it for this one at least. There migth be a few more things to write about with the various options and so forth. However all I wanted is to just extract a rar file, and if that is all I care about this works just fine.
Conclusion
What is great about unar is that it is pretty brainless to use once installed, so far it does that what I need it to do. So then there might only be so much to write about with this one. I looks like there are a whole lot of other formats that unar will work great for when it comes to extracting at least with with other formats such as 7zip and so forth.
There might be more to write about when it comes to making a compressed file rather than extracting one in the rar format. With that said there might be some addtional options to look for. There is the general tar command to look into when it comes to making these kinds of files in other fomats.