Extract single file using file name from a rar/zip file

Maniteja Mittapelli
2 min readMar 20, 2023

--

#extractsinglefile #insufficientstorage #mac #terminalextraction #extractionusingfilename

I think everyone has this problem mainly mac users who have less storage on their device and they want to extract compressed files like rar/zip.

In this blog I also explain about extracting rar files in mac, because there is no free uncompressing softwares for rar files in mac.

Follow the steps carefully to unzip/unrar in mac using terminal

we are using 7zip console version in mac. follow steps to download 7zip click on this link to go to 7zip download page 7zipdownload

download 7-zip 21.07 (2021–12–26) .tar.xz file, macOS (arm64 / x86–64) console version and make it executable so you can use 7-zip in termianl

to extract a file use this command below, type 7zz x and drag file into the terminal and press enter it will extract dragged file into your user folder.

7zz x uncompressed_file

I think you understand how to extract any file, but let’s talk about main problem i.e Extracting big files when storage is insufficient

Let’s assume we have a rar file of 100GB consists of 10 files each of 10 GB, So while extracting this file we should have atleast 200GB of storage 100GB for uncompressed file and 100GB for extracted folder, but problem is you have 150GB of storage and 100GB is already used by rar file and we have 50GB remaining so we can’t extract the rar file completely.

so we are extracting single file from the rar file using that ‘single file name’. And how do we get the file names inside a rar file. so to get these names use this command

7zz l uncompressed_file

The above command give the list of names in the rar file and their size, copy the file name which you want to extract, and use this command to extract only that file from rar file

7zz e 'uncompressed_file' 'single_file'

Now you are going to have a rar file of 100GB and an extracted single file of 10GB and you will have 40GB still free storage of 150GB.

--

--

No responses yet