unzip .tar.gz file in terminal [duplicate]

How do I unzip a .tar.gz file in the terminal? I'm not able to do so in GUI, because I want to extract it to a /usr directory, and will need the sudo command.

0

1 Answer

Let me Google that for you 😬

$ gzip -d this_is_the_file.tar.gz
$ tar -xvf this_is_the_file.tar

These can be combined, but it's probably better to start out with the two commands independently. Put the sudo wherever you need it.

  • gzip -d ⇢ Decompress
  • tar -xvf ⇢ Extract, Verbose, File

This should do what you need.

1

You Might Also Like