how to compress folder in ubuntu command line tar code example Example: how to tar linux tar -zcvf file.tar.gz /path/to/dir/