Besides the man page (man tar
), ther is a much more verbose info
manual for the tar untility (info tar
).
tar -cf arch.tar *
tar -czf
arch.tar.gz *
tar -cjf
arch.tar.bz2 *
Say you are in /tmp and you want to create an archive of your directory ~/collections/music/project1, but you don't want to see this part of the path in the archive entries:
tar -cvf arch.tar -C /different/Directory/ .
cd /different/Directory/
; tar -cvf
/directory/for/tar/archive.tar *
-t
option to list the contents of an archive: tar -tf
arch.tar
tar -tzf arch.tgz
or tar -tjf arch.tar.bz2
.