Linux/terminal

tar, zxvf

Naranjito 2024. 2. 26. 11:53
  • tar(Tape ARchiver)

 

Available directly in the terminal, the tar command helps create, extract, and list archive contents.

 

  • -zxvf

 

- z: Tells tar to filter the archive through gzip.

- x: Tells tar to extract files.

- v: Stands for "verbose" mode, which displays details about the extraction process and files being extracted.

- f: Indicates that the next argument (/tmp/efficientdet.tar.gz) is the name of the archive file.


tar -zxvf /tmp/efficientdet.tar.gz --strip-components 2 --directory source_dir/checkpoint efficientdet_d1_coco17_tpu-32/checkpoint

 

  • --strip-components 2

 

This option tells tar to remove the specified number of leading components from the file names when extracting.

In this case, it removes 2 leading components from the paths of the files in the archive.

 

  • --directory

 

Put the file here.

 

  • efficientdet_d1_coco17_tpu-32/checkpoint

 

This is the path within the archive where the files to be extracted are located.