tar command?

Hello,How to zip and unzip a directory and its subdirectories excluding a list of subdirectories using tar command. Can someone give me an example?
[161 byte] By [nagarajan] at [2007-11-26 6:20:26]
# 1
I am really disappointed with this forum. 68 times this thread has been viewed and not a single response. Anways i have figured out the answer myself. Google answers better.Thanks y'all anways.
nagarajan at 2007-7-6 14:05:02 > top of Java-index,General,Talk to the Sysop...
# 2
man tar(just review the man pages, that is why no one bothered to answer you)
rukbat at 2007-7-6 14:05:02 > top of Java-index,General,Talk to the Sysop...
# 3
Perhaps a clearer picture of what you are trying to do would help.Are you archiving data, removing from media devices. what are you trying to do?Are these ziped tar files? come back.....
goldhunt at 2007-7-6 14:05:02 > top of Java-index,General,Talk to the Sysop...
# 4

Use the tar command with the 'f' being the name of the tar ball file i.e.

tar cvf /tmp/my_tarball.tar <directory to be backed up>. This will create a single tar file that includes the backup directories. Then pipe it to compress which will then compress the tar ball into a .Z file

tar cvf /tmp/my_tarfile.tar I compress

Unzip in reverse

uncompress my_tarfile.tar.Z | tar xvf -

goosegrease at 2007-7-6 14:05:02 > top of Java-index,General,Talk to the Sysop...
# 5

First a suggestion for the Board administrator(s) -- Perhaps we also need a UNIX Neophyte forum where previous neophyte questions can be posted and/or new newbie questions as well?

if the file is a tar.gz file and you have gzip installed on your system:

gzcat /my/src/mytarball.tar.gz|tar xvf - (make sure you're in the directory where you want to explode this tarball).

Also you can verify whether the tarball has been created with relative file paths or absolute file paths (gzcat /my/src/mytarball.tar.gz|tar tvf -).

You can substitute similar syntax depending on whether the file has been compressed, gziped, bzip2'ed etc.

Compress -- .Z (uncompress to uncompress and zcat to "cat" the Compressed file)

gzip -- .gz (gunzip to ungzip and gzcat to "cat" the gziped file)

bzip2 -- .bz2 (bunzip2 and bzcat)

Or you could download and install a copy of the GNU tar utility -- which will give you the ability to run :

tar zxvf to extract gzip files

tar jxvf to extract bzip files...

and so on...

Nuff sed -- someone had already pointed you to the man pages.

1) man man to learn how to RTF<ine>M

2) man tar to learn how to use tar

implicate_order at 2007-7-6 14:05:02 > top of Java-index,General,Talk to the Sysop...