how to create a tar.gz file of a folder in linux code example Example: create tar gz file from directory tar -czf tarball.tar.gz my_directory/