know-how.dev

How to extract tar.gz archive in Linux or macOS

3 years ago 815

Most Linux distros and macOS have tar program pre-installed by default, it can be used to extract tar.gz archives. Command structure is next:

tar -xzvf archive.tar.gz /path/to/file/or/dir

What these flags mean:

  • -x - instructs tar that we are going to extract archive;
  • -z - use gzip as compression method;
  • -f archive.tar.gz - specifies archive file name to extract;
  • -v - enables verbose mode.