As titled. I want to use some command, like for .zip files I can say
unzip myfiles.zip -d mydirectory
But is there a thing for .tar file on Mac as well?
On a Mac, just double-click the TAR, TGZ, or TAR. GZ file to unpack it. On Windows, you'll need free software like 7-Zip to untar files. If you're using Linux or the Mac Terminal app, use "tar -xvf" for TAR files, or "tar -xvzf" for files ending in TGZ or TAR.
Yes, you can run:
tar -xvf myfile.tar
For .tar.gz, you can run:
tar -xzvf myfile.tar.gz
If you want to extract to any directory other than your cwd, use -C. e.g:
tar -xvf myfile.tar -C somedirectory
I suggest you read the man page for tar if you wish to do anything further:
man tar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With