how to tar linux

tar -zcvf file.tar.gz /path/to/dir/