9951 explained code solutions for 126 technologies


cli-tarHow do I extract a tar.gz file using the command line?


Extracting a tar.gz file using the command line requires the use of the tar command. This command is used to create, modify, and extract tar archives.

The command to extract a tar.gz archive is as follows:

tar -xzvf <filename>.tar.gz

This command will extract the contents of the tar.gz archive to the current directory.

The command parts are as follows:

  • tar: The tar command is used to create, modify, and extract tar archives.
  • -xzvf: The -xzvf options are used to extract the tar archive.
  • <filename>.tar.gz: This is the name of the tar.gz archive that you want to extract.

Helpful links

Edit this code on GitHub