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
+23k Golang : untar or extract tar ball archive example
+31k error: trying to remove "yum", which is protected
+13.3k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+13.2k Golang : Calculate elapsed years or months since a date
+9.3k Golang : Simple histogram example
+12.6k Elastic Search : Return all records (higher than default 10)
+7.6k Golang : Process json data with Jason package
+7k Fix sudo yum hang problem with no output or error messages
+18.1k Golang : Defer function inside init()
+11.4k CodeIgniter : How to check if a session exist in PHP?
+12.3k Golang : Sort and reverse sort a slice of runes
+39.2k Golang : How to iterate over a []string(array)