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:
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
tar cf my.tar test1.txt test2.txt test3.txt
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:
tar -xzvf [file.tar.gz]will extract all files in archive into [dir_to_extract]
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.
|All times are GMT -4. The time now is 06:56 PM.|
Linux and Unix Supported by: vBulletin
Search Engine Optimisation provided by DragonByte SEO v1.0.3 (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
The UNIX and Linux Forums Content Copyright ©1993-2013. All Rights Reserved.
Forum Operations by The UNIX and Linux Forums