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
+17.2k Golang : Padding data for encryption and un-padding data for decryption
+22k Golang : minus time with Time.Add() or Time.AddDate() functions to calculate past date
+14.9k Golang : Get file permission
+6.2k Golang : alternative to os.Exit() function
+28.6k Golang : Remove characters from string example
+19.1k Golang : Pipe output from one os.Exec(shell command) to another command
+29.1k Golang : Interpolating or substituting variables in string examples
+15.6k Golang : Find file size(disk usage) with filepath.Walk
+11.3k Swift : Convert (cast) Int or int32 value to CGFloat
+15.5k Golang : Capture stdout of a child process and act according to the result
+7.2k Android Studio : Import third-party library or package into Gradle Scripts
+6.2k Golang : Rot13 and Rot5 algorithms example