Extract Zip or Rar files using the terminal on MAC OS X
16,798
Solution 1
You can usually use tar
or zip
for file compression. Something like
tar -x ~/somefile.zip
will extract the somefile.zip
in your home folder to sub-folders defined in the zip.
tar -czf ~/mynewzip.zip ~/datafolder
will compress ~/datafolder
to newzip.zip in your home folder. Make sure to read the man page for tar or zip for more details.
Solution 2
I guess following command will do the purpose:
unrar x <file_name>.rar
If unrar is not installed, you can use:
brew install unrar
Related videos on Youtube
Author by
S. Comu
Updated on September 18, 2022Comments
-
S. Comu over 1 year
I have just started to work on a Mac terminal for a school work.
My question is: which command do I have to write to extract files of a .zip or .rar file by using the terminal only? Is it the same command to open all types of compressed files?
Thanks in advance.
-
user almost 7 yearsI don't know what's available on a stock OS X installation, which is why I'm not making this an answer, but for zip files, have you tried
unzip
? -
S. Comu almost 7 yearsI have just tried to use this command and it's correct. Thanks!
-