Create a tar file of an entire directory and its sub-directories
Linux November 2nd, 2005To create a tar archive of an entire directory including all files and sub-directories:
tar -cvf mytarfile.tar mydir/
To create a tar archive of an entire directory including all files and sub-directories:
tar -cvf mytarfile.tar mydir/
July 15th, 2007 at 12:32 pm
tar -cvfz mytarfile.tgz mydir/ will also compress the directory (gzip)
August 8th, 2007 at 2:07 pm
Also … for a more universally compatible file try
# zip -rv9 myzipfile.zip /mydir
-9 is for maximum compression
-v is for verbose output
-r is recursive directories
May 19th, 2008 at 10:45 am
The problem with the zip format is that it does not store file permissions.