tar parameters

Hi,

I'm not a very experienced in unix and I need some help. I'm trying to figure out what tar parameters to use to store a directory structure and the files within this directory structure. I also need to know how to extract this tar file from one unix machine to another unix machine.

If anyone can help, this would be great. Thanks.

My best recommendation is to read the manual page for it. Type this:
man tar

If you need more help, feel free to post back.

It too recommend the man pages, or perhaps even a Unix book. But these are the baics:

To create the tar file:
tar cf <tar file name> <file1> <file2> <file3> etc
Example
tar cf my.tar test1.txt test2.txt test3.txt
or
tar cf my.tar test*
Wild cards can be used with tar if you didn't know.

To see what is in the tar file

tar tvf <tar file name>

To extract the tar file
tar xvf my.tar

These are the basics. You may need to use other options depending on what you want to accomplish. If you just want to tar up a directory on one system and extract it on another, you could do this:

tar cf my.tar <directory>
this command should be run from one directory above the directory you are putting in the tar. If you do an ls, you will see the directory listed.
ftp my.tar (in binary) to the other system and put it in the directory you would like it to be under when you extract it then run:
tar xf my.tar

Hope this helps a little.

There is an useful info which you might want to use. If your tar-red file is also gziped you must supply the "-z" parameter:
cd /[dir_to_extract]
tar -xzvf [file.tar.gz]will extract all files in archive into [dir_to_extract]
or:
cd [directory]
tar -zcvf [archive_name] *
will create the archive which will finally contain all the files in diectory, including subdirs

That assumes you have gzip and the GNU tar utility installed on your system. With Linux and Hurd, this is nearly always the case. On other systems (HP-UX, SysV, etc...) it is not this way unless you install it.