I often need to package and compress a folder from the command line, for example, before running updates so I have a fall back position.
The following works for me
tar -czf filename.tar.gz foldername
So when I had a folder named www and from the command prompt I could see it, and wanted to name the file www-040713.tar.gz it was
tar -czf www-040713.tar.gz www
c = create
z = compress
f = file