Unix/Linux : How to open tar.gz file ?
It has been a while since I touched tar files( have been using Mac for long time) and couple of days back I need to open up a tar and gzipped file.
Need to do a tar -h
to see how to open up the tar.gz archive
Without much ado, the command to open a tar.gz file looks like this :
tar -zxvf nicephotos.tar.gz -C /nicephotos
Basically the command above is to :
-z Uncompress archive with gzip format
-x Extract the files in the archive
-v Verbose mode ( more information)
-f
Location of archive -C
<target dir>
Change to<target dir>
before processing remaining files (output files to the target directory)
Just in case you want to view the archive content before uncompressing. You can use this command
tar -tzvf nicephotos.tar.gz
- -t will list only entries that match( display everything)
Hope this short tutorial is useful for you.
See also : Unix/Linux : How to archive and compress entire directory ?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+19.2k Golang : How to force compile or remove object files first before rebuild?
+18.6k Golang : Set or Add HTTP Request Headers
+7.9k Golang : Get SPF and DMARC from email headers to fight spam
+9.2k Golang : Resolve domain name to IP4 and IP6 addresses.
+37.9k Golang : How to iterate over a []string(array)
+18.3k Golang : Convert seconds to human readable time format example
+17.2k Golang : How to get hour, minute, second from time?
+5.1k Golang : Missing Subversion command
+7.7k Golang : Combine slices but preserve order example
+11.2k Golang : How to check if a string starts or ends with certain characters or words?
+17.4k Golang : Check whether a network interface is up on your machine
+20.9k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."