> I am in need of some actual examples of commands to create tar files.
> I have a directory I want to turn into a tar.gz file.
> I need it to include all files and sub directory's with ownership, mode
> and everything intact.
> Please post answers here.
> Thank you
Assuming you are user root and IN directory /home and further assuming
/home contains directory joe/ and fred/ (with subdirectories), you can
create a compressed tar file joefred.tar.gz (or joefred.taz) with the
gtar -zcvf joefred.taz joe fred
The ownerships, etc. will be preserved.
You can extract the tar INTO YOUR PRESENT WORKING DIRECTORY with
gtar -zxvf joefred.taz
the directories joe/ and fred/ will be created and permissions will be set
as they were saved (assuming those group/user id's exist on the system the
tar is extracted on).