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?
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
--strip=1
. If you need to "flatten" out the extracted files to aid with automation, play with this and see if it will help.
Commented
May 9, 2020 at 4:28