Site icon

Using .tgz files



To create a .tgz file, we used tar with the following parameters -czf:



Please note that the order of the parameters will not change the result.


To extract a .tgz or .tar.gz file using tar we used the following parameters -xzf:

  • -x or --extract --get will extract the files from the archive. Arguments are optional. When given, they specify names of the archive members to be extracted.
  • -z– or --gzip or --gunzip or --ungzip will filter the archive through gzip and decompress it.
  • -f or --file=ARCHIVE will use archive file or device ARCHIVE. If this option is not given, tar will first examine the environment variable TAPE. If it is set, its value will be used as the archive name. Otherwise, tar will assume the compiled-in default.


tar -xzf $ARCHIVE_FILE_NAME.tgz;

This post is also available in: Greek

Exit mobile version