using gnu tar reference

Published: Wednesday, Dec 26, 2007 Last modified: Friday, May 24, 2024

List files in tar archive:

tar tf whatishere.tar

Lets tar up a folder, without CVS dir:

tar --exclude=CVS -cf test.tar datastructuresproject/

And more:

hendry@bilbo:~$ tar --exclude=CVS --exclude=*.pdf --exclude=*.vim --exclude=*.pyc -cf datastructuresproject.tar datastructuresproject/
hendry@bilbo:~$ ls datastructuresproject/  common.pyc  CVS  efficient.pyc  match.pyc  p333-aho-corasick.pdf  Session.vim  text  trans.pyc

To extract:

tar xvf thefile.tar

One file:

tar -z --extract --file=control.tar.gz ./control

Redirection seems to work:

tar zxv < control.tar.gz ./control

A listing

hendry@bilbo:/tmp/scratch$ tar zvt < control.tar.gz
drwxr-xr-x root/root         0 2004-05-30 18:30:10 ./
-rw-r--r-- root/root     12059 2004-05-30 18:30:10 ./md5sums
-rw-r--r-- root/root       840 2004-05-30 18:30:10 ./control