unpacking .tar files with cli on macOS

Unzipping or unpacking .tar files typically is handled seamlessly by macOS. If it isn’t automatically done when the file is downloaded, you can do so by double clicking on it. I’ve noticed that some files on certain releases during testing might not handle this as well. The Archive utility just hangs without completing the process. Using the CLI commands below seems to work very well in these instances.

Unpacking .tar.gz files

First, ensure that you have a shell running and cd to the same directory as the downloaded file. To unpack a .tar.gz file, say foo.tar.gz, use the following command:

gunzip -c foo.tar.gz | tar xopf –

The newly extracted files will be created in the current directory. If you also wish to see a list of the files as they are extracted, instead use the command

gunzip -c foo.tar.gz | tar xopft –

Unpacking .tar files

First, ensure that you have a shell running and cd to the same directory as the downloaded file. To unpack a .tar file, say foo.tar, use the following command:

tar xopf foo.tar

The newly extracted files will be created in the current directory. If you also wish to see a list of the files as they are extracted, instead use the command

tar xopft foo.tar

Reference: http://magma.maths.usyd.edu.au/magma/faq/extract

EdTech Chris
About Admin

Digital Plumber • Disruptive Educator • Asst IT Director for Eanes ISD • Husband & Father • Passionate about connecting w/ & supporting educators.

Similar Posts