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
+12.7k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+39.7k Golang : How to check if a string contains another sub-string?
+19.5k Golang : Clean up null characters from input data
+4.3k JavaScript/JQuery : Redirect page examples
+12.9k Golang : Convert IP version 6 address to integer or decimal number
+6.3k Golang : How to handle file size larger than available memory panic issue
+16.7k Golang : Get command line arguments
+4k Javascript : How to get width and height of a div?
+6.2k Golang : Use modern ciphers only in secure connection
+6.5k Golang : Handling Yes No Quit query input
+6.8k Javascript : How to check a browser's Do Not Track status?
+5.9k Golang : Calculate BMI and risk category