tar gz folder linux code example
Example 1: gzip folder with tar
tar -zcvf my-filename.tar.gz my-folder-name
Example 2: create tar gz file from directory
tar -czf tarball.tar.gz my_directory/
Example 3: linux tar zip folder
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Example 4: compress folder in tar.gz unix
tar -zcvf final_archive.tar.gz folder_to_compress/
tar cf - ./folder_to_compress/ | pigz -9 -p NPROC > final_archive.tar.gz
Example 5: how to put directory in archive bash
tar cf ostechnix.tar ostechnix/