分类: LINUX
2006-06-25 08:38:27
The convention is tar [options] filename1 [ filename2, ... filenameN ] directory1 [ directory2, ...directoryN ]. After the archive is created, you can transfer bundle.tar conveniently. Now you want to extract the bundle.tar archive. You can execute:tar cvf bundle.tar blank.txt stuff/
and you'll get a file called blank.txt and a directory called stuff in your current working directory.tar xvf bundle.tar
We add 'z' to the tar options and also append '.gz' onto the archive name for convention. To extract a compressed archive, do:tar czvf bundle.tar.gz blank.txt stuff/
The tar command knows about another compression algorithm called bzip2. To use bzip2 instead of gzip, replace the 'z' in the previous two commands with a 'j' For example:tar xzvf bundle.tar.gz
The tar man pages are an excellent resource for more information about the advanced options of the tar command, type man tar from the command line.tar cjvf bundle.tar.bz2 blank.txt stuff/
tar xjvf bundle.tar.bz2