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.3k Golang : Web(Javascript) to server-side websocket example
+13.2k Golang : How to shuffle elements in array or slice?
+21.7k Golang : Randomly pick an item from a slice/array example
+4.9k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+12.8k Golang : Simple word wrap or line breaking example
+32.2k Golang : Create x509 certificate, private and public keys
+27.8k Golang : Get first few and last few characters from string
+15.4k Golang : File path independent of Operating System
+5.3k PHP : Proper way to get UTF-8 character or string length
+12.9k Golang : syscall.Socket example
+8.8k Golang : Test a slice of integers for odd and even numbers
+8.6k Golang : How to check if a website is served via HTTPS