Linux tar for unzipping

1
tar xvzf file.tar.gz

x: This option tells tar to extract the files.

v: The “v” stands for “verbose.” This option will list all of the files one by one in the archive.

z: The z option is very important and tells the tar command to uncompress the file (gzip).

f: This options tells tar that you are going to give it a file name to work with.

Note:
For compressing files, you can use

1
tar cvfz file.tar.gz dir/

The z tell that the files are compressed using gzip, and we usually name the zipped file .tar.gz.

Reference

  1. How To Extract .tar.gz Files using Linux Command Line
  2. 每天一个linux命令(61):tar命令