Home | Mirror | Search |
目錄
tar
tar -cvf foo.tar foo/ tar contents of folder foo in foo.tar tar -xvf foo.tar extract foo.tar
tar -zcvf foo.tar foo/ tar contents of folder foo in foo.tar.gz
tar -xvzf foo.tar.gz extract gzipped foo.tar.gz
tar -jcvf foo.tar.bz2 foo/ tar contents of folder foo in foo.tar.bz2 tar -jxvf foo.tar.bz2 extract b2zip foo.tar.bz2
tar -Zcvf foo.tar.Z foo/ tar contents of folder foo in foo.tar.Z tar -Zxvf foo.tar.Z extract compress foo.tar.Z
-P, --absolute-names don't strip leading `/'s from file names
$ tar -czvPf neo.tar.gz /home/neo/ $ tar -xzvPf neo.tar.gz
-C, --directory=DIR change to directory DIR
解壓到目標目錄
tar -xzvf neo.tar.gz -C /tmp
排除neo目錄
tar --exclude /home/neo -zcvf myfile.tar.gz /home/* /etc tar zcvf rpmbuild/SOURCES/netkiller-1.0.tar.gz ~/workspace/public_html/* --exclude .git --exclude .svn
find . -name "*.jpg" -print >list tar -T list -czvf picture.tar.gz find /etc/ | tar czvf xxx1.tar.gz -T -
tar -jcpvf - file.php | ssh root@172.16.3.1 "tar -jxpvf -"