The tar
commands compresses files together. You can compress a directory, including all its files, by running:
tar -zcvf archive.tar.gz my-directory
z
compresses with gzip, c
creates an archive, v
turns on verbose output, f
represents the archive file name.
Read more on nixCraft.