9951 explained code solutions for 126 technologies


cli-tarHow do I use the Unix tar xzvf command?


The Unix tar xzvf command is used to extract files from a compressed tar archive.

tar xzvf archive.tar.gz

This command will extract all files in the archive.tar.gz file and create a directory with the same name as the archive.

Code explanation

  • tar – The tar command is used to create, view, extract, and manipulate archives.
  • x – The x option tells tar to extract the files from the archive.
  • z – The z option tells tar to decompress the archive using gzip.
  • v – The v option tells tar to display verbose output while it extracts the files.
  • f – The f option tells tar to use the archive.tar.gz file as the archive to extract.

No output is generated from this command.

Helpful links

Edit this code on GitHub