How to Extract tar.gz Files using Terminal Command

Posted on

How to Extract tar.gz Files using Terminal Command. Tar.gz files is an archive files, just like .rar or .zip. If you are using GUI, it is easy to extract this archive file. Just right click on file, and click “extract file” options. But, if you handle this file on linux server, you need terminal command to extract tar.gz file.

You can use tar command to extract tar.gz file, and it is very simple. For example, i have file named linuxsec.tar.gz. And command to extract it is:

tar -xzvf linuxsec.tar.gz

And i will explain what options using in this command.

  • x mean extract. option to extract the file
  • z is option to tell tar to extract the file using gzip method
  • v stand for verbose, and you know what it mean..
  • f is option to tell tar that you are going to give it a file name to work with

Actually, you can extrat the file using just two option, x and f. Example

tar -xf linuxsec.tar.gz

Or if you just want to see content of archive file, without extract it, you can using this command

tar -tvf linuxsec.tar.gz

Ok. So, that’s for today. Ask me everything if you have any problem with this tutorial. And dont forget to share it if you think it is helpful. Thank you and see you in the next tutorial.

Gravatar Image
Budak korporat yang hobi nulis. Pengguna Kali Linux sebagai daily driver. Kadang nonton anime di waktu luang.

Leave a Reply

Your email address will not be published.