Last Updated on 2021-09-15 by Clay
There is a pre-installed decompression tool in Mac OS, but it is mainly for zip files. If you want to decompress a compressed file like .7z, you must use a dedicated software (or command line program) to decompress it.
Below I will introduce The Unarchiver, a tool that can be installed in the App Store, and the p7zip command line tool that can be installed through Homebrew.
The Unarchiver
The Unarchiver can be downloaded directly from the App Store, and the file format of The Unarchiver can be selected in advance.
p7zip
You can install it as following:
brew install p7zip
After installation, if you want to compress the file (assuming it is the test/ folder), you can use the following command:
7z a test.7z test/
If you want to unzip the file, use the following command:
7z x test.7z
If you want to view the file more carefully, you can use the man
command to confirm.
References
- https://apple.stackexchange.com/questions/307377/how-can-i-unpack-7z-files-via-macos-terminal
- https://superuser.com/questions/548349/how-can-i-install-7zip-so-i-can-run-it-from-terminal-on-os-x