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
+29.6k Golang : Login(Authenticate) with Facebook example
+27.6k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+12.3k Golang : Detect user location with HTML5 geo-location
+10.3k Golang : Use regular expression to get all upper case or lower case characters example
+8k Golang Hello World Example
+14.5k Golang : How to shuffle elements in array or slice?
+7k Golang : Pat multiplexer routing example
+9.7k Golang : Validate IPv6 example
+5.9k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+8.2k Golang : Multiplexer with net/http and map
+16.6k Golang : Convert slice to array
+16.2k Golang : How to reverse elements order in map ?