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
+3.4k Golang : Switch Redis database redis.NewClient
+13.6k Golang : How to check if a file is hidden?
+5.7k Golang : Extract unicode string from another unicode string example
+4.3k Javascript : Detect when console is activated and do something about it
+8.9k Golang : Write multiple lines or divide string into multiple lines
+9k Golang : Generate EAN barcode
+6.9k Nginx : How to block user agent ?
+20.5k Golang : Underscore or snake_case to camel case example
+7.3k Golang : Get YouTube playlist
+6.9k Golang : Get environment variable
+42.8k Golang : Get hardware information such as disk, memory and CPU usage
+8.5k Golang : Take screen shot of browser with JQuery example