How to pack a .tar.gz archive 📥
Pack a directory:
tar cfvz [name of archive].tar.gz [name of directory]
tar cfvz images.tar.gz images
Pack multiple files:
tar cfvz [name of archive].tar.gz [file1] [file2] ...
tar cfvz images.tar.gz image1.png image2.png ...
What does cfvz mean?
- c / create
- f / file
- v / verbose - Lists all files that are being packed (optional)
- z / compress
Unpack a .tar.gz archive 📤
Unpack archive into current directory
tar xvf [name of archive].tar.gz
tar xvf archive.tar.gz
Unpack archive into another directory
tar xvf [name of archive].tar.gz -C [name of directory]
tar xvf archive.tar.gz -C directory/
What does xvf mean?
- x / extract
- v / verbose - Lists all files that are being packed (optional)
- f / file