Quick and dirty - How to create a “tarball”.
By now everyone has seen the wonderfull myproject.tar.gz, I say wonderful as to extract the ‘project’ or whatever is contained in the tarball can be accomplished with a single command and viola, all the files are extracted with all of thier subdirectories and files in tact, complete with unix permissions.
So you’d like to backup your website or project for distribution, easy enough
tar everything up
[server]$ tar -cf myproject.tar myprojectdir myotherprojectdir
and gzip it
[server]$ gzip myproject.tar
the result is will net you myproject.tar.gz all ready to do as you will with.
Explaination the -cf switch is simply create file, if you like you can use -vcf to display a verbose listing as tar moves along to ensure you are getting the intended files and directories.
myprojectdir myotherprojectdir are just the directories you which to include, this list can be one, two, or more diectories.
gzip will compress your .tar file and leave you with the resulting .gz, so of you want to retain a copy of the .tar be sure to make a copy before gzip.
As mentioned earlier, to extract your shiny new tarball once you have it in the desired directory, you can do this with one command,
[system]$ tar -xzvf myproject.tar.gz
Easy