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
+8.2k Golang : Multiplexer with net/http and map
+6.3k Golang : Extract sub-strings
+6.3k Golang : Get Hokkien(福建话)/Min-nan(閩南語) Pronounciations
+25.5k Golang : Convert long hexadecimal with strconv.ParseUint example
+17.1k Golang : Covert map/slice/array to JSON or XML format
+13.3k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+19.9k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+13.4k Golang : Date and Time formatting
+6.3k PHP : Get client IP address
+10.7k Golang : ISO8601 Duration Parser example
+6.4k Golang : Detect face in uploaded photo like GPlus
+5.9k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error